/* Milligram Customization & Dashboard Layout CSS */
/* --- FONTS (Inter) --- */
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100;
  src: url('../fonts/inter-v20-latin-100.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100;
  src: url('../fonts/inter-v20-latin-100italic.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 200;
  src: url('../fonts/inter-v20-latin-200.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: italic;
  font-weight: 200;
  src: url('../fonts/inter-v20-latin-200italic.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/inter-v20-latin-300.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: italic;
  font-weight: 300;
  src: url('../fonts/inter-v20-latin-300italic.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/inter-v20-latin-regular.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: italic;
  font-weight: 400;
  src: url('../fonts/inter-v20-latin-italic.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/inter-v20-latin-500.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: italic;
  font-weight: 500;
  src: url('../fonts/inter-v20-latin-500italic.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/inter-v20-latin-600.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: italic;
  font-weight: 600;
  src: url('../fonts/inter-v20-latin-600italic.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/inter-v20-latin-700.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: italic;
  font-weight: 700;
  src: url('../fonts/inter-v20-latin-700italic.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  src: url('../fonts/inter-v20-latin-800.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: italic;
  font-weight: 800;
  src: url('../fonts/inter-v20-latin-800italic.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 900;
  src: url('../fonts/inter-v20-latin-900.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: italic;
  font-weight: 900;
  src: url('../fonts/inter-v20-latin-900italic.woff2') format('woff2');
}
:root {
    --color-primary: #df751d;
    --color-accent: #df751d;
    --color-bg: #f8f6f1;
    --color-sidebar: #202528;
    --color-text: #34383b;
    --color-text-dark: #151719;
    --sidebar-width: 260px;
    --header-height: 70px;
}

/* =========================================
   1. BASE LAYOUT & RESET
   ========================================= */
body {
    margin: 0;
    padding: 0;
    background-color: var(--color-bg);
    display: flex;
    font-family: var(--admin-font-family, 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.fluid-container {
    max-width: 100%;
    margin: 0;
}

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

/* =========================================
   2. SIDEBAR (Fixed Navigation)
   ========================================= */
.layout-sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-sidebar);
    border-right: 1px solid #e2e8f0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 2.5rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15rem;
    color: var(--color-text-dark);
}

/*.sidebar-brand span {
    color: var(--color-accent);
}*/

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1.2rem 1.5rem;
    color: var(--color-text);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.4rem;
}

.nav-link:hover {
    background-color: #f8fafc;
    color: var(--color-accent);
}

.nav-link-active {
    background-color: #f1f5f9;
    color: var(--color-accent);
    font-weight: 700;
    border-left: 4px solid var(--color-accent);
    padding-left: calc(1.5rem - 4px);
}

.sidebar-footer {
    padding: 2rem 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.sidebar-logout {
    width: 100%;
    text-align: center;
}

/* =========================================
   3. MAIN AREA & STICKY HEADER
   ========================================= */
.layout-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
}

.layout-header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

.breadcrumbs a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--color-accent);
}

.breadcrumbs span {
    margin: 0 1rem;
    color: #cbd5e1;
    font-weight: 400;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.user-info p {
    margin: 0;
    line-height: 1.2;
}

.user-name {
    font-weight: 700;
    color: var(--color-text-dark);
    text-transform: uppercase;
    font-size: 1.2rem;
}

.user-role {
    font-size: 0.9rem;
    color: var(--color-text);
    text-transform: uppercase;
    font-weight: 500;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background-color: var(--color-text-dark);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.layout-content {
    padding: 4rem 3rem;
    flex: 1;
}

/* =========================================
   4. FLASH MESSAGES (Alert System)
   ========================================= */
.flash-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.flash-msg {
    padding: 1.2rem 2rem;
    border-radius: 12px;
    color: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    min-width: 300px;
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

.flash-success { background-color: #10b981; }
.flash-error { background-color: #f43f5e; }

.flash-msg span {
    margin-right: 1.2rem;
    font-size: 1.6rem;
}

.flash-msg p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

.flash-anim-hide {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.4s ease;
}

/* =========================================
   1. DASHBOARD UTILITIES & GRID SYSTEM
   ========================================= */

/* --- Spacing & Flex Helpers --- */
.mb-medium { margin-bottom: 2rem; }
.mb-large { margin-bottom: 4rem; }
.flex-grow { flex-grow: 1; }
.flex-col { display: flex; flex-direction: column; }
.m-0 { margin: 0 !important; }

/* --- CSS Grid System (Mobile First) --- */
.css-grid {
    display: grid;
    gap: 2.5rem; /* Konsistenter Abstand für alle Dashboard-Elemente */
    grid-template-columns: 1fr; /* Standard: Einspaltig für Mobile */
}

/* Responsive Breakpoints für Grids */
@media (min-width: 40.0rem) { /* Milligram Breakpoint */
    .grid-2 { grid-template-columns: repeat(auto-fit, minmax(600px, 1fr)); }
    .grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
    .grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
    .grid-5 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

/* Spezielle Grid-Gaps & Layouts */
.gap-large { gap: 4rem; }
.layout-span-2 { grid-column: span 1; }

@media (min-width: 40.0rem) {
    .layout-span-2 { grid-column: span 2; }
}

/* --- Tool Cards (Steuerelemente für Optimierung/Backup) --- */
.tool-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2.5rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--color-text-dark);
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
}

.tool-icon {
    font-size: 2.8rem;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 12px;
    flex-shrink: 0;
}

.tool-card p {
    margin: 0;
    font-weight: 800;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-style: italic;
}

/* Tool Card Varianten */
.tool-dark {
    background: #0f172a;
    border-color: #1e293b;
    color: #f8fafc;
}

.tool-dark .tool-icon {
    background: rgba(255, 255, 255, 0.05);
}

.tool-dark:hover {
    background: #1e293b;
    border-color: var(--color-accent);
}

.tool-dark-alt {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

.tool-dark-alt:hover {
    background: #334155;
    border-color: var(--color-accent);
}

/* Breite Tool-Variante (z.B. für Cache leeren) */
.tool-card-wide {
    display: flex;
    text-align: left;
    justify-content: flex-start;
}

.align-text-left {
    text-align: left;
}

.hover-red:hover {
    background: #fef2f2;
    color: #e11d48;
}

/* =========================================
   2. DASHBOARD HEADER (Hero Section)
   ========================================= */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 4rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.header-title h1 {
    font-size: 3.8rem;
    font-weight: 900;
    text-transform: uppercase;
    font-style: italic;
    margin: 0 0 0.5rem 0;
    line-height: 0.9;
    letter-spacing: -0.05em;
    color: var(--color-text-dark);
}

.header-title p {
    color: var(--color-text);
    font-size: 1.4rem;
    font-weight: 500;
    font-style: italic;
    margin: 0;
}

.header-title strong {
    color: var(--color-text-dark);
    border-bottom: 3px solid var(--color-accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* =========================================
   3. STATUS INDICATORS & BADGES
   ========================================= */

/* --- Outline Badges (z.B. Server Time) --- */
.badge-outline {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-dark);
}

/* --- Status Banners (z.B. Update-Check im Dashboard) --- */
.status-banner {
    display: block;
    padding: 1.2rem 1.8rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 1.5rem 0;
    border: 1px solid transparent;
}

.banner-success {
    background-color: #f0fdf4;
    border-color: #dcfce7;
    color: #166534;
}

.banner-warning {
    background-color: #fffbeb;
    border-color: #fef3c7;
    color: #92400e;
}

.banner-error {
    background-color: #fef2f2;
    border-color: #fee2e2;
    color: #991b1b;
}

/* --- Allgemeine Badges (Listen & Formulare) --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1.2rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f1f5f9;
    color: #475569;
}

.badge-dark {
    background: #0f172a;
    color: #ffffff;
}

.badge-admin {
    background: #0f172a;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}

.badge-error {
    background: #fff1f2;
    color: #e11d48;
}

.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

/* =========================================
   4. CARDS (Information Units)
   ========================================= */
.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-large {
    padding: 4rem;
    border-radius: 28px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.card-label {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0;
}

.card-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--color-text-dark);
    text-transform: uppercase;
    font-style: italic;
    margin-bottom: 1.5rem;
    line-height: 1;
}

.card-footer {
    border-top: 1px solid #f1f5f9;
    padding-top: 2rem;
    margin-top: auto;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    text-transform: uppercase;
    font-style: italic;
}

/* --- EMPTY STATES (Innerhalb von Cards oder Containern) --- */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state-table {
    padding: 8rem 2rem;
    background: #fcfdfe;
    border-radius: 0 0 20px 20px;
}

.empty-icon-large {
    font-size: 5rem;
    margin-bottom: 2rem;
    opacity: 0.2;
    display: block;
}

.empty-icon-giant {
    font-size: 8rem;
    margin-bottom: 3rem;
    opacity: 0.15;
    display: block;
    color: var(--color-text-dark);
}

.empty-state p {
    font-size: 1.4rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-style: italic;
    margin: 0;
}

/* =========================================
   5. ALERTS & NOTIFICATIONS
   ========================================= */
.alert-zone {
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.alert-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid transparent;
    flex-wrap: wrap; /* Erlaubt Umbruch auf Mobile */
    gap: 2rem;
}

.alert-warning { background-color: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-error   { background-color: #fef2f2; border-color: #fecaca; color: #991b1b; }

.alert-content {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    flex: 1; /* Nimmt verfügbaren Platz ein */
    min-width: 280px; /* Verhindert zu starkes Zusammendrücken */
}

.alert-icon { 
    font-size: 3.5rem; 
    flex-shrink: 0;
}

.alert-title {
    font-size: 1.6rem;
    font-weight: 900;
    margin: 0 0 0.4rem 0;
    text-transform: uppercase;
    font-style: italic;
    letter-spacing: -0.02em;
}

.alert-desc { 
    margin: 0; 
    font-size: 1.3rem; 
    font-weight: 500; 
    line-height: 1.4;
}

/* Flex-Handling für Buttons in Alerts */
.alert-box .button {
    margin: 0;
    white-space: nowrap;
}

/* Responsive Anpassung für Alerts */
@media (max-width: 40.0rem) {
    .alert-box {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .alert-box .button {
        width: 100%; /* Button auf Mobile volle Breite */
    }

    .alert-content {
        gap: 1.5rem;
    }

    .alert-icon {
        font-size: 2.8rem;
    }
}

/* =========================================
   6. PROGRESS & SPECS
   ========================================= */
.progress-bar {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 1.5rem 0;
}

.progress-track {
    flex-grow: 1;
    background: #f1f5f9;
    height: 10px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    background: var(--color-text-dark);
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

.spec-value {
    display: block;
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--color-text-dark);
    font-style: italic;
    letter-spacing: -0.05em;
}

.spec-value small {
    font-size: 1.2rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-style: normal;
    margin-left: 0.5rem;
}

/* =========================================
   7. FORENSIC CONSOLE (Logs)
   ========================================= */
.console-box {
    background: #0f172a;
    border-radius: 24px;
    padding: 3.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: #f8fafc;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

.console-heading {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    margin-bottom: 3.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.console-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.console-logs {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 1rem;
}

.log-entry {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.2rem 1.8rem;
    border-radius: 10px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.level-error { color: #f87171; border-left: 3px solid #f87171; }
.level-security { color: #34d399; border-left: 3px solid #34d399; }
.level-info { color: #60a5fa; border-left: 3px solid #60a5fa; }

/* =========================================
   8. CUSTOM BUTTONS (Milligram Overrides)
   ========================================= */
.button-black {
    background-color: #0f172a;
    border-color: #0f172a;
    height: 4.5rem;
    line-height: 4.5rem;
    padding: 0 3rem;
}

.button-black:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: #ffffff;
}

.button-error {
    background-color: #e11d48;
    border-color: #e11d48;
}

.button-error:hover {
    background-color: #be123c;
    border-color: #be123c;
}

/* =========================================
   1. SETTINGS HEADER & LAYOUT HELPERS
   ========================================= */
.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 2.5rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.icon-accent {
    color: var(--color-accent);
    opacity: 0.9;
}

.col-full { grid-column: 1 / -1; }
.border-bottom { border-bottom: 1px solid #e2e8f0; }
.pb-medium { padding-bottom: 2.5rem; }
.mt-medium { margin-top: 2.5rem; }
.m-0 { margin: 0 !important; }

/* =========================================
   2. FORM ELEMENTS OVERRIDES
   ========================================= */
.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
    display: block;
}

.help-text {
    font-size: 1rem;
    color: var(--color-text);
    font-style: italic;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.color-picker-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.color-picker-group input[type="color"] {
    width: 50px;
    height: 50px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

/* =========================================
   3. SECURITY CARD (Dark Theme)
   ========================================= */
.card-dark {
    background: #0f172a;
    border: 1px solid #1e293b;
    color: #f8fafc;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.card-dark label, 
.card-dark strong {
    color: #e2e8f0;
}

.card-dark .help-text {
    color: #94a3b8;
}

.dark-input-group textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #334155;
    color: var(--color-accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    padding: 1.5rem;
    border-radius: 12px;
}

.dark-input-group textarea:focus {
    border-color: var(--color-accent);
    background: rgba(0, 0, 0, 0.5);
}

/* =========================================
   4. TOGGLE SWITCH COMPONENT
   ========================================= */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.8rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.toggle-row:hover {
    background: #ffffff;
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 30px;
    margin: 0;
}

.toggle-switch input {
    opacity: 0; width: 0; height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--color-accent);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* =========================================
   5. PERFORMANCE CARDS
   ========================================= */
.perf-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 2rem;
    border-radius: 16px;
    transition: all 0.2s ease;
}

.perf-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.perf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.perf-header strong {
    font-size: 1.2rem;
    color: var(--color-text-dark);
    text-transform: uppercase;
}

/* =========================================
   6. NAVIGATION BUILDER (Interactive List)
   ========================================= */
.nav-item-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: #ffffff;
    padding: 1.5rem 2.5rem;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s ease;
}

.nav-item-row:hover {
    box-shadow: var(--shadow-md);
}

.nav-item-new {
    background: #f0f9ff;
    border-style: dashed;
    border-color: #0ea5e9;
}

.nav-icon-wrapper {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}

.nav-inputs {
    flex-grow: 1;
}

.nav-input-large {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-text-dark);
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    box-shadow: none !important;
}

.nav-input-large:focus {
    color: var(--color-accent);
}

.nav-input-small {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    color: #94a3b8;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-pos-input {
    width: 55px;
    text-align: center;
    font-weight: 800;
    font-size: 1.4rem;
    border-radius: 8px;
    padding: 0.5rem;
}

.button-delete {
    color: #94a3b8;
    transition: color 0.2s;
}

.button-delete:hover {
    color: #ef4444;
}

/* =========================================
   7. STICKY ACTION FOOTER & FORM FOOTERS
   ========================================= */

/* --- 7.1 Der schwebende Sticky-Footer (Settings) --- */
.sticky-footer {
    position: sticky;
    bottom: 3rem;
    z-index: 40;
    margin-top: 6rem;
    pointer-events: none; /* Erlaubt Klicks auf darunterliegende Elemente */
}

.sticky-footer-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 3rem;
    background: #0f172a; /* Slate 900 */
    border-radius: 40px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    pointer-events: auto; /* Aktiviert Klicks für den Button-Bereich */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- 7.2 Der statische dunkle Footer (User Edit / Forms) --- */
.form-footer-dark {
    background: #020617; /* Slate 950 - Etwas dunkler als die Karte */
    border: 1px solid #0f172a;
    border-radius: 24px;
    padding: 2.5rem 3rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2.5rem;
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.2);
    margin-top: 4rem;
}

/* --- 7.3 Footer-Elemente (Buttons & Links) --- */
.button-large {
    font-size: 1.3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 25px;
    height: 5rem;
    line-height: 5rem;
    padding: 0 4rem;
    margin: 0;
    background-color: var(--color-accent);
    border: none;
    transition: all 0.2s ease;
}

.button-large:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.btn-link-muted {
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 800;
    font-size: 1.1rem;
    text-decoration: none;
    transition: color 0.2s;
}

.btn-link-muted:hover {
    color: #f8fafc;
}

/* --- 7.4 Responsive Handling (Kritische Fixes) --- */
@media (max-width: 40.0rem) {
    /* Sticky Footer auf Mobile anpassen */
    .sticky-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 1.5rem;
        background: #0f172a;
        z-index: 100;
        border-radius: 0;
        border-top: 2px solid var(--color-accent);
    }

    .sticky-footer-inner {
        padding: 0;
        background: transparent;
        box-shadow: none;
        border: none;
    }

    /* Statischer Footer auf Mobile */
    .form-footer-dark {
        padding: 2rem;
        flex-direction: column-reverse;
        gap: 1.5rem;
        border-radius: 16px;
    }

    .button-large, 
    .sticky-footer .button {
        width: 100%;
        text-align: center;
        padding: 0;
    }

    /* Content-Padding erhöhen, damit der Footer nichts verdeckt */
    .layout-content {
        padding-bottom: 10rem;
    }
}
/* =========================================
   1. PAGE HEADER & FILTER BAR
   ========================================= */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 2.5rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.filter-bar {
    padding: 0.5rem;
    margin: 0;
    flex-grow: 1;
    max-width: 650px;
}

.filter-form {
    display: flex;
    gap: 1.2rem;
    margin: 0;
    flex-wrap: wrap;
}

.filter-form select {
    width: auto;
    margin: 0;
    font-weight: 800;
    font-size: 1.1rem;
    text-transform: uppercase;
    border-radius: 10px;
    background-color: #fff;
    border-color: #e2e8f0;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
    min-width: 250px;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    color: #94a3b8;
    pointer-events: none;
}

.search-input-wrapper input {
    margin: 0;
    padding-left: 4rem;
    border-radius: 10px;
    height: 4.5rem;
    border-color: #e2e8f0;
}

.section-heading-small {
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: #94a3b8;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* =========================================
   2. LOG CHANNELS (Sidebar-Navigation)
   ========================================= */
.channel-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.channel-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.8rem 2.2rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.channel-link:hover {
    border-color: var(--color-accent);
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.channel-label {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #94a3b8;
}

.channel-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-text-dark);
    margin-top: 0.3rem;
}

.channel-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.channel-active {
    background: #0f172a;
    border-color: #0f172a;
    box-shadow: 0 10px 20px -5px rgba(15, 23, 42, 0.3);
}

.channel-active .channel-label { color: #60a5fa; }
.channel-active .channel-name { color: #ffffff; }

/* =========================================
   3. TERMINAL WINDOW (The Core)
   ========================================= */
.terminal-window {
    background: #020617;
    border-radius: 24px;
    border: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    min-height: 750px;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid #1e293b;
}

.mac-dots {
    display: flex;
    gap: 0.8rem;
}

.mac-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-close { background: #ff5f56; }
.dot-min   { background: #ffbd2e; }
.dot-max   { background: #27c93f; }

.terminal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.title-label { color: #475569; margin-right: 1rem; }
.file-active { color: #60a5fa; font-weight: 700; }

/* =========================================
   4. LOG ENTRIES (Data-Density focus)
   ========================================= */
.terminal-body {
    flex-grow: 1;
    padding: 2rem 0;
    max-height: 800px;
    overflow-y: auto;
    background-image: radial-gradient(circle at 50% 0%, rgba(30, 41, 59, 0.4), transparent);
    display: flex;
    flex-direction: column;
}

/* Custom Terminal Scrollbar */
.terminal-body::-webkit-scrollbar { width: 8px; }
.terminal-body::-webkit-scrollbar-track { background: #020617; }
.terminal-body::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }
.terminal-body::-webkit-scrollbar-thumb:hover { background: #334155; }

.log-entry {
    padding: 1.2rem 3rem;
    border-left: 4px solid transparent;
    transition: background 0.15s ease;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.03);
    border-left-color: var(--color-accent);
}

.log-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    gap: 1.5rem;
}

.log-badge {
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: 0.3rem 1rem;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.badge-error, .badge-critical, .badge-emergency {
    background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.2);
}

.badge-security {
    background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2);
}

.log-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    color: #64748b;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.8rem;
    border-radius: 5px;
}

.log-message {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3rem;
    color: #e2e8f0;
    line-height: 1.6;
    word-break: break-all;
    margin: 0;
}

.log-context {
    margin-top: 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.context-header span {
    font-size: 0.9rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    font-style: italic;
}

.log-context pre {
    color: #93c5fd;
    font-size: 1.2rem;
    margin: 1rem 0 0 0;
    white-space: pre-wrap;
}

/* =========================================
   5. TERMINAL FOOTER & STATES
   ========================================= */
.terminal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    padding: 1.2rem 3rem;
    border-top: 1px solid #1e293b;
}

.terminal-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: #475569;
    font-style: italic;
}

.terminal-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12rem 0;
}

.empty-icon { font-size: 6rem; opacity: 0.1; color: #fff; margin-bottom: 2rem; }
.empty-text {
    color: #334155;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-style: italic;
}
/* =========================================
   1. TABLE ARCHITECTURE (Card Wrapper)
   ========================================= */
.card-table {
    padding: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.card-table table {
    margin: 0;
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

/* =========================================
   2. TABLE HEADERS & BODY
   ========================================= */
.card-table th {
    background: #f8fafc;
    border-bottom: 2px solid #f1f5f9;
    font-size: 0.95rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 1.8rem 2.5rem;
    text-align: left;
    white-space: nowrap;
}

.card-table td {
    padding: 1.2rem 2.5rem; /* Optimierte Datendichte */
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--color-text-dark);
}

.card-table tbody tr {
    transition: background-color 0.15s ease;
}

.card-table tbody tr:hover {
    background-color: #fcfdfe; /* Subtiler Hover-Effekt */
}

.card-table tbody tr:last-child td {
    border-bottom: none;
}

/* =========================================
   3. USER CELL & AVATARS
   ========================================= */
.user-cell {
    display: flex;
    align-items: center;
    gap: 1.8rem;
}

.avatar-small {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    background-color: var(--color-text-dark);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    font-style: italic;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.user-info-col {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.user-name-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text-dark);
    line-height: 1;
}

.user-email-text {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* =========================================
   4. ACTION GROUPS & ICON BUTTONS
   ========================================= */
.action-group {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5; /* Kräftigere Icons */
}

.btn-icon:hover {
    background: #ffffff;
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-icon-danger:hover {
    background: #fff1f2;
    border-color: #fb7185;
    color: #e11d48;
}

.btn-icon-disabled {
    background: #f1f5f9;
    color: #cbd5e1;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.5rem;
    font-weight: 700;
}

.icon-svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.btn-with-icon:hover .icon-svg {
    transform: rotate(90deg);
}

/* =========================================
   5. UTILITIES & EMPTY STATES
   ========================================= */
.badge-admin {
    background: #0f172a;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.empty-state-table {
    padding: 6rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.empty-icon-large {
    font-size: 4rem;
    color: #e2e8f0;
    margin-bottom: 1.5rem;
}

.record-count {
    margin-top: 2.5rem;
    padding: 0 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.align-middle { vertical-align: middle !important; }
/* =========================================
   1. FORM LAYOUT & CONTAINER
   ========================================= */
.form-container {
    max-width: 850px; /* Optimale Breite für Lesbarkeit */
    margin: 0 auto;
}

/* =========================================
   2. ERROR STATES & VALIDATION
   ========================================= */
.has-error input, 
.has-error select, 
.has-error textarea {
    border-color: #f43f5e !important;
    background-color: #fff1f2 !important;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1) !important;
}

.has-error input:focus {
    border-color: #e11d48 !important;
}

.error-text {
    color: #e11d48;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    font-style: italic;
    margin: 0.6rem 0 0 0.5rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-text::before {
    content: '!';
    display: inline-flex;
    width: 1.6rem;
    height: 1.6rem;
    background: #e11d48;
    color: #fff;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-style: normal;
    font-size: 1rem;
}

/* =========================================
   3. PROTECTED ROLE FIELD (Non-Editable)
   ========================================= */
.protected-role {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #0f172a;
    color: #ffffff;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.3rem;
    border: 1px solid #1e293b;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    cursor: not-allowed;
}

.protected-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.protected-note {
    color: #64748b;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-style: normal;
    font-weight: 600;
}

.icon-lock {
    width: 16px;
    height: 16px;
    color: var(--color-accent);
    opacity: 0.8;
}

/* =========================================
   4. PASSWORD VALIDATION CHECKLIST
   ========================================= */
.pw-checklist {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 1.5rem;
}

.pw-checklist-list {
    list-style-type: none;
    padding-left: 0;
}

.checklist-title {
    font-size: 1rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    display: block;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.8rem;
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.checklist-item {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #94a3b8;
    transition: all 0.2s ease;
}

.checklist-item .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #cbd5e1;
    margin-right: 1rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.checklist-item.is-valid {
    color: #10b981;
}

.checklist-item.is-valid .dot {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* =========================================
   5. FORM FOOTER (Action Area)
   ========================================= */
.form-footer-dark {
    background: #020617; /* Slate 950 */
    border: 1px solid #0f172a;
    border-radius: 24px;
    padding: 2rem 3rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    margin-top: 4rem;
}

/* Ergänzung für Abbrechen-Buttons im Footer */
.btn-link-muted {
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 800;
    font-size: 1.1rem;
    text-decoration: none;
    transition: color 0.2s;
}

.btn-link-muted:hover {
    color: #f8fafc;
}
/* =========================================
   1. HEADER ACTIONS & UPLOAD INTERFACE
   ========================================= */
.header-actions-group {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.upload-form-wrapper {
    display: flex;
    align-items: center;
	justify-content: center;
    background: #ffffff;
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease;
    gap: 1rem;
}

.upload-form-wrapper:focus-within {
    border-color: var(--color-accent);
}

.file-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.file-input-container input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-custom-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.icon-btn .refresh-icon {
    display: inline-block;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-btn:hover .refresh-icon {
    transform: rotate(180deg);
}

/* =========================================
   2. PLUGIN CARDS (Grid & Layout)
   ========================================= */
.plugin-list-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.plugin-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-wrap: wrap;
    gap: 2.5rem;
    position: relative;
}

.plugin-active {
    border-left: 8px solid var(--color-text-dark); /* Refined von 12px */
    box-shadow: var(--shadow-sm);
}

.plugin-active:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.plugin-inactive {
    opacity: 0.75;
    background: #fcfdfe;
    filter: grayscale(0.5);
}

.plugin-inactive:hover {
    opacity: 1;
    filter: grayscale(0);
    background: #ffffff;
}

/* =========================================
   3. CONTENT & ICONOGRAPHY
   ========================================= */
.plugin-main-content {
    display: flex;
    align-items: center;
    gap: 3.5rem;
    flex: 1;
}

.plugin-icon-box {
    width: 72px;
    height: 72px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.plugin-details {
    flex: 1;
}

.plugin-title-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.plugin-name {
    margin: 0;
    font-size: 2rem; /* Balancierte Größe */
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.03em;
}

.plugin-name a {
    color: var(--color-text-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.plugin-name a:hover {
    color: var(--color-accent);
}

.plugin-description {
    font-size: 1.3rem;
    line-height: 1.5;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

/* =========================================
   4. STATUS PILLS & ACTIONS
   ========================================= */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.pill-success { 
    background: #ecfdf5; 
    color: #059669; 
    border-color: #d1fae5; 
}

.pill-muted { 
    background: #f1f5f9; 
    color: #64748b; 
    border-color: #e2e8f0; 
}

.plugin-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.button-icon-only {
    width: 52px;
    height: 52px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    transition: all 0.2s ease;
}

.button-icon-only:hover {
    background: var(--color-text-dark);
    border-color: var(--color-text-dark);
    color: #ffffff;
    transform: scale(1.05);
}

/* =========================================
   5. EMPTY STATES
   ========================================= */
.empty-state-box {
    padding: 10rem 2rem;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 32px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.empty-state-box:hover {
    border-color: var(--color-accent);
}

.empty-icon-giant {
    font-size: 7rem;
    opacity: 0.15;
    display: block;
    margin: 0 auto 3rem;
    color: var(--color-text-dark);
}
/* =========================================
   1. AUTH LAYOUT & WRAPPER
   ========================================= */
.auth-body {
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 2rem;
}

.auth-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 110rem; 
}

/* =========================================
   2. THE AUTH CARD (High-Focus Container)
   ========================================= */
.auth-card {
    background: #ffffff;
    border-radius: 2.5rem;
    padding: 5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.12), 0 18px 36px -18px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

/* Dekorative Akzent-Linie am oberen Rand */
.auth-accent-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0.8rem;
}

.line-dark    { background-color: var(--color-text-dark); }
.line-accent  { background-color: var(--color-accent); }
.line-warning { background-color: #f59e0b; }
.line-error   { background-color: #f43f5e; }

/* =========================================
   3. AUTH HEADER & ICONOGRAPHY
   ========================================= */
.auth-header {
    text-align: center;
    margin-bottom: 4.5rem;
}

.auth-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 8.5rem;
    height: 8.5rem;
    background: #f8fafc;
    border-radius: 2.2rem;
    margin-bottom: 2.5rem;
    border: 1px solid #f1f5f9;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.box-error { 
    background-color: #fff1f2; 
    border-color: #fecaca; 
}

.auth-icon-box .icon { 
    font-size: 3.8rem; 
}

.auth-title {
    font-size: 3.2rem;
    font-weight: 900;
    text-transform: uppercase;
    font-style: italic;
    margin: 0;
    letter-spacing: -0.04em;
    color: var(--color-text-dark);
}

.auth-subtitle {
    font-size: 1.4rem;
    color: #94a3b8;
    margin-top: 0.8rem;
    font-style: italic;
    font-weight: 500;
}

/* =========================================
   4. FLASH MESSAGES (Auth Specific)
   ========================================= */
.flash-box {
    padding: 1.8rem 2.2rem;
    border-radius: 1.6rem;
    margin-bottom: 3.5rem;
    display: flex;
    align-items: center;
    font-weight: 700;
    font-style: italic;
    font-size: 1.25rem;
    border: 1px solid transparent;
}

.flash-error { 
    background: #fff1f2; 
    color: #be123c; 
    border-color: #fecaca; 
    border-left: 6px solid #f43f5e; 
}

.flash-success { 
    background: #ecfdf5; 
    color: #065f46; 
    border-color: #d1fae5; 
    border-left: 6px solid #10b981; 
}

.flash-icon { 
    margin-right: 1.8rem; 
    font-size: 2rem; 
}

/* =========================================
   5. AUTH FORM ELEMENTS
   ========================================= */
.auth-form .form-group { 
    margin-bottom: 2.8rem; 
}

.auth-form label {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #94a3b8;
    margin-bottom: 1.2rem;
    display: block;
}

.form-disabled { 
    opacity: 0.5; 
    pointer-events: none; 
    filter: grayscale(1);
}

.error-msg {
    color: #e11d48;
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    font-style: italic;
    margin-top: 0.8rem;
}

/* =========================================
   6. BUTTONS & INTERACTION
   ========================================= */
.btn-auth {
    height: 6.5rem;
    font-size: 1.3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    border-radius: 1.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.button-black { background-color: var(--color-text-dark); border: none; color: #fff; }
.button-accent { background-color: var(--color-accent); border: none; color: #fff; }

.btn-auth:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px -5px rgba(0,0,0,0.2);
}

.btn-auth:active { transform: scale(0.98); }

.btn-arrow { 
    margin-left: 1.5rem; 
    transition: transform 0.3s ease; 
}

.btn-auth:hover .btn-arrow { 
    transform: translateX(6px); 
}

/* =========================================
   7. PASSWORD CHECKLIST (Auth Context)
   ========================================= */
.pw-checklist-box {
    background: #f8fafc;
    padding: 2.5rem;
    border-radius: 2rem;
    margin: 2rem 0 3.5rem;
    border: 1px solid #e2e8f0;
}

.checklist-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 1.2rem; 
    list-style: none; 
    margin: 0; 
    padding: 0;
}

.checklist-item { 
    font-size: 1.1rem; 
    font-weight: 700; 
    color: #94a3b8; 
    display: flex; 
    align-items: center;
    transition: color 0.2s ease;
}

.checklist-item .dot { 
    width: 0.7rem; 
    height: 0.7rem; 
    background: #cbd5e1; 
    border-radius: 50%; 
    margin-right: 1.2rem; 
}

.checklist-item.is-valid { color: #10b981; }
.checklist-item.is-valid .dot { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }

/* =========================================
   8. SPECIAL STATES (Rate Limit / Maintenance)
   ========================================= */
.rate-limit-msg {
    padding: 2.5rem;
    text-align: center;
    border: 1px solid #fecaca;
    background: #fff1f2;
    border-radius: 2rem;
    color: #e11d48;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

.maintenance-badge {
    text-align: center;
    margin-bottom: 2.5rem;
}

.maintenance-badge span {
    padding: 1rem 2.5rem;
    background: #fffbeb;
    color: #92400e;
    font-weight: 800;
    border-radius: 5rem;
    border: 1px solid #fde68a;
    font-size: 1.1rem;
    text-transform: uppercase;
}

/* =========================================
   9. FOOTER & NAVIGATION
   ========================================= */
.auth-footer {
    text-align: center;
    margin-top: 5rem;
}

.auth-footer p { 
    font-size: 1.1rem; 
    color: #94a3b8; 
    font-weight: 700; 
    text-transform: uppercase; 
}

.back-link { 
    font-size: 1.2rem; 
    color: #64748b; 
    font-weight: 800; 
    text-transform: uppercase; 
    text-decoration: none; 
    transition: color 0.2s;
}

.back-link:hover { color: var(--color-text-dark); }

/* =========================================
   10. ANIMATIONS
   ========================================= */
.fade-in-up { 
    animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards; 
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.pulse { animation: pulseAnim 2.5s infinite ease-in-out; }

@keyframes pulseAnim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.98); }
}
/* =========================================
   5. MODAL & MOBILE OVERRIDES
   ========================================= */

/* --- 5.1 Mobile Navigation Logic --- */
@media (max-width: 1024px) {
    /* Sidebar verstecken */
    .layout-sidebar {
        transform: translateX(-100%);
        width: 280px; /* Etwas breiter auf Mobile für bessere Lesbarkeit */
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.2);
    }

    /* Main Content auf volle Breite */
    .layout-main {
        margin-left: 0;
        width: 100%;
    }

    /* Header Anpassung */
    .layout-header {
        padding: 0 2rem;
    }

    /* Breadcrumbs auf Mobile kürzen oder verstecken */
    .breadcrumbs span:not(:last-child),
    .breadcrumbs a:not(:last-child) {
        display: none;
    }

    /* Sidebar-Zustand für die mobile Navigation. */
    .sidebar-open .layout-sidebar {
        transform: translateX(0);
    }

    /* Overlay wenn Sidebar offen */
    .sidebar-open::before {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(2, 6, 17, 0.6);
        backdrop-filter: blur(4px);
        z-index: 15;
    }

    /* Grids auf Einspaltig zwingen */
    .css-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }
}

/* --- 5.2 Micro-Interactions Mobile --- */
@media (max-width: 480px) {
    .layout-content {
        padding: 2.5rem 1.5rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
}


/* =========================================
   6. CSP UTILITIES (No-Inline-Styles)
   ========================================= */

/* --- Dashboard-spezifische CSP-Klassen --- */
.dynamic-memory-bar {
    /* Breite wird über CSS-Variable vom TemplateContext gesetzt */
    width: var(--memory-width, 0%);
    background-color: var(--color-text-dark);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 6.4 Hilfsklassen für Formulare --- */
.form-inline-reset { 
    margin: 0 !important; 
}

.protected-role .icon-lock {
    color: var(--color-accent);
}

    .matrix-category-row td { padding-top: 1rem; padding-bottom: 0.5rem; border-top: 2px solid #eee; }
    .capability-matrix td { vertical-align: middle; }
    .bg-lightest { background-color: #fafafa; }

/* --- Login Form Utilities (CSP Compliant) --- */
.password-label-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.password-label-margin-reset {
    margin-bottom: 0 !important;
}

.forgot-password-link {
    font-size: 0.85rem;
    color: var(--color-accent);
    text-decoration: none;
}

    .help-text {
        font-size: 1.05rem;
        color: #6c757d;
        margin-top: 4px;
        line-height: 1.6;
    }

/* ==========================================================================
   ADMIN DESIGN TOKENS UND LAYOUT-BASIS
   ========================================================================== */

:root {
    /* ADMIN-R1.2 authoritative design foundation. */
    --admin-font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --admin-font-weight-regular: 400;
    --admin-font-weight-medium: 500;
    --admin-font-weight-semibold: 600;
    --admin-font-weight-bold: 700;

    --admin-bg: #f8f6f1;
    --admin-bg-subtle: #f3f0e9;
    --admin-surface: #ffffff;
    --admin-surface-raised: #ffffff;
    --admin-surface-muted: #ebe7de;
    --admin-surface-dark: #202528;
    --admin-surface-dark-soft: #2c3235;

    --admin-text: #34383b;
    --admin-text-strong: #151719;
    --admin-text-muted: #62676a;
    --admin-text-soft: #696e71;
    --admin-text-inverse: #f8f6f1;

    --admin-border: rgba(21, 23, 25, 0.13);
    --admin-border-strong: rgba(21, 23, 25, 0.22);

    /* Orange ist Branding, Primäraktion, Link, Fokus und Auswahl. */
    --admin-primary: #df751d;
    --admin-primary-hover: #b95713;
    --admin-primary-soft: #fff3e8;
    --admin-primary-border: #c67a39;

    --admin-brand: #df751d;
    --admin-brand-strong: #b95713;
    --admin-brand-soft: #f3d1b2;
    --admin-brand-border: #dfa16d;

    /* Semantische Farben bleiben echten Statusinformationen vorbehalten. */
    --admin-success: #067647;
    --admin-success-soft: #edf8f1;
    --admin-warning: #9a6700;
    --admin-warning-soft: #fff8e7;
    --admin-danger: #b42318;
    --admin-danger-soft: #fff0ef;
    --admin-info: #3d6f8e;
    --admin-info-soft: #eef6fa;

    --admin-radius-xs: 0.6rem;
    --admin-radius-sm: 0.9rem;
    --admin-radius-md: 1.2rem;
    --admin-radius-lg: 1.6rem;
    --admin-radius-xl: 2.2rem;
    --admin-radius-pill: 999px;

    --admin-elevation-0: none;
    --admin-elevation-1:
        0 1px 2px rgba(21, 23, 25, 0.06),
        0 1px 3px rgba(21, 23, 25, 0.04);
    --admin-elevation-2:
        0 4px 12px rgba(21, 23, 25, 0.08),
        0 2px 4px rgba(21, 23, 25, 0.04);
    --admin-elevation-3:
        0 10px 28px rgba(21, 23, 25, 0.11),
        0 4px 10px rgba(21, 23, 25, 0.05);
    --admin-elevation-4:
        0 20px 48px rgba(21, 23, 25, 0.16),
        0 8px 18px rgba(21, 23, 25, 0.06);

    --shadow-xs: var(--admin-elevation-1);
    --shadow-sm: var(--admin-elevation-1);
    --shadow-md: var(--admin-elevation-2);
    --shadow-lg: var(--admin-elevation-3);
    --shadow-xl: var(--admin-elevation-4);

    --admin-motion-fast: 120ms;
    --admin-motion-standard: 180ms;
    --admin-motion-slow: 240ms;
    --admin-motion-ease: cubic-bezier(0.2, 0, 0, 1);
    --admin-focus-ring:
        0 0 0 3px color-mix(in srgb, var(--admin-primary) 22%, transparent);

    --sidebar-width: 272px;
    --header-height: 72px;

    /* Legacy aliases stay mapped while ADMIN-R1 migrates old selectors. */
    --color-primary: var(--admin-primary);
    --color-accent: var(--admin-brand);
    --color-bg: var(--admin-bg);
    --color-sidebar: var(--admin-surface-dark);
    --color-text: var(--admin-text);
    --color-text-dark: var(--admin-text-strong);
}

/* --------------------------------------------------------------------------
   Foundation
   -------------------------------------------------------------------------- */

.cc-icon {
    display: inline-block;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    overflow: visible;
    color: currentColor;
    fill: none;
    vertical-align: -0.25em;
}

.cc-icon--sm {
    width: 1.8rem;
    height: 1.8rem;
}

.cc-icon--lg {
    width: 2.4rem;
    height: 2.4rem;
}

.cc-icon use {
    pointer-events: none;
}

html {
    background: var(--admin-bg);
}

body,
body.admin-shell {
    min-height: 100vh;
    color: var(--admin-text);
    background:
        radial-gradient(
            circle at 75% -10%,
            color-mix(in srgb, var(--color-accent) 5%, transparent),
            transparent 35rem
        ),
        var(--admin-bg);
}

body.admin-shell {
    display: block;
}

::selection {
    color: #ffffff;
    background: var(--color-accent);
}

a {
    color: var(--color-accent);
    text-underline-offset: 0.18em;
}

a:hover {
    color:
        color-mix(
            in srgb,
            var(--color-accent) 84%,
            #000000
        );
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline:
        3px solid
        color-mix(
            in srgb,
            var(--color-accent) 24%,
            transparent
        );

    outline-offset: 2px;
}

.fluid-container {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.layout-sidebar {
    width: var(--sidebar-width);
    color: var(--admin-text-inverse);
    background:
        radial-gradient(
            circle at 0 0,
            color-mix(
                in srgb,
                var(--color-accent) 20%,
                transparent
            ),
            transparent 22rem
        ),
        var(--admin-surface-dark);

    border-right: 0;
    box-shadow:
        inset -1px 0 rgba(255, 255, 255, 0.05);

    transition:
        transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
        width 220ms ease;
}

.sidebar-brand {
    height: auto;
    min-height: var(--header-height);
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 1rem;
    color: #ffffff;
    text-decoration: none;
}

.sidebar-brand-link:hover {
    color: #ffffff;
}

.sidebar-brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 3.8rem;
    width: 3.8rem;
    height: 3.8rem;

    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--color-accent),
            color-mix(
                in srgb,
                var(--admin-brand, var(--color-accent, #ff7300)) 70%,
                #000000
            )
        );

    border-radius: 1.15rem;
    box-shadow:
        0 8px 22px
        color-mix(
            in srgb,
            var(--color-accent) 22%,
            transparent
        );

    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.sidebar-brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.15;
}

.sidebar-brand-copy strong {
    overflow: hidden;
    color: #ffffff;
    font-size: 1.65rem;
    font-weight: 850;
    letter-spacing: -0.045em;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
}

.sidebar-brand-copy strong span {
    color:
        color-mix(
            in srgb,
            var(--color-accent) 70%,
            #ffffff
        );
}

.sidebar-brand-copy small {
    margin-top: 0.25rem;
    color: #98a2b3;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sidebar-close-button {
    display: none;
    place-items: center;
    width: 3.4rem;
    height: 3.4rem;
    margin: 0 0 0 auto;
    padding: 0;

    color: #cbd5e1;
    background: transparent;
    border: 0;
    border-radius: 0.9rem;

    font-size: 2.4rem;
    line-height: 1;
    cursor: pointer;
}

.sidebar-nav {
    padding: 1.4rem 1rem;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;

    min-height: 4.6rem;
    margin: 0.25rem 0;
    padding: 0.85rem 1rem;

    color: #aeb8c8;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 1rem;

    font-size: 1.35rem;
    font-weight: 650;
    line-height: 1.2;

    transition:
        color 150ms ease,
        background-color 150ms ease,
        border-color 150ms ease,
        transform 150ms ease;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(255, 255, 255, 0.06);
}

.nav-link-active {
    padding-left: 1rem;
    color: #ffffff;
    background:
        linear-gradient(
            90deg,
            color-mix(
                in srgb,
                var(--color-accent) 20%,
                transparent
            ),
            rgba(255, 255, 255, 0.045)
        );

    border-color:
        color-mix(
            in srgb,
            var(--color-accent) 30%,
            rgba(255, 255, 255, 0.08)
        );

    box-shadow:
        inset 3px 0
        var(--color-accent);
}

.nav-link-icon {
    display: grid;
    place-items: center;
    flex: 0 0 3rem;
    width: 3rem;
    height: 3rem;

    background: rgba(255, 255, 255, 0.055);
    border-radius: 0.8rem;

    font-size: 1.4rem;
    filter: grayscale(0.1);
}

.nav-link-active .nav-link-icon {
    background:
        color-mix(
            in srgb,
            var(--color-accent) 18%,
            rgba(255, 255, 255, 0.06)
        );
}

.nav-link-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-footer {
    padding: 1.2rem 1.2rem 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.8rem;

    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 1rem;
}

.sidebar-user-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 3.4rem;
    width: 3.4rem;
    height: 3.4rem;

    color: #ffffff;
    background:
        color-mix(
            in srgb,
            var(--color-accent) 24%,
            #1e293b
        );

    border-radius: 0.9rem;

    font-size: 1.2rem;
    font-weight: 800;
}

.sidebar-user-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.sidebar-user-copy strong,
.sidebar-user-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-copy strong {
    color: #f8fafc;
    font-size: 1.15rem;
}

.sidebar-user-copy small {
    margin-top: 0.1rem;
    color: #94a3b8;
    font-size: 0.9rem;
    text-transform: capitalize;
}

.sidebar-logout-form {
    width: 100%;
    margin: 0;
    padding: 0;
}

.sidebar-logout-form .sidebar-logout {
    width: 100%;
    min-height: 3.8rem;
    margin: 0;

    color: #d0d5dd;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.14);
}

.sidebar-logout-form .sidebar-logout:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(255, 255, 255, 0.22);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 18;

    display: none;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;

    background: rgba(15, 23, 42, 0.56);
    border: 0;
    border-radius: 0;

    backdrop-filter: blur(3px);
    cursor: default;
}

/* --------------------------------------------------------------------------
   Header / Main
   -------------------------------------------------------------------------- */

.layout-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    background: transparent;
}

.layout-header {
    height: var(--header-height);
    padding: 0 2.4rem;

    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(228, 231, 236, 0.9);
    box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);

    backdrop-filter: blur(18px) saturate(145%);
}

.layout-header-left {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-button {
    display: none;
    width: 4rem;
    height: 4rem;
    margin: 0;
    padding: 0.9rem;

    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 1rem;

    cursor: pointer;
}

.mobile-menu-button span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 0.35rem 0;

    background: var(--admin-text-strong);
    border-radius: 999px;
}

.breadcrumbs {
    min-width: 0;
    font-size: 1.18rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

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

.breadcrumbs a:hover {
    color: var(--color-accent);
}

.breadcrumbs strong {
    overflow: hidden;
    color: var(--admin-text-strong);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb-separator,
.breadcrumbs > span {
    margin: 0 0.75rem;
    color: var(--admin-border-strong);
}

.user-profile {
    gap: 1rem;
}

.user-name {
    color: var(--admin-text-strong);
    font-size: 1.15rem;
    font-weight: 750;
    text-transform: none;
}

.user-role {
    margin-top: 0.12rem !important;
    color: var(--admin-text-muted);
    font-size: 0.9rem;
    font-weight: 550;
    text-transform: capitalize;
}

.user-avatar {
    width: 4rem;
    height: 4rem;

    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--admin-surface-dark),
            color-mix(
                in srgb,
                var(--color-accent) 38%,
                var(--admin-surface-dark)
            )
        );

    border-radius: 1.1rem;
    box-shadow: var(--shadow-sm);
}

.layout-content {
    flex: 1;
    padding:
        clamp(2rem, 3vw, 3.2rem)
        clamp(1.6rem, 3vw, 3.2rem)
        4rem;
}

/* --------------------------------------------------------------------------
   Typography / Page Heads
   -------------------------------------------------------------------------- */

.page-header,
.dashboard-header,
.settings-header {
    align-items: flex-start;
    margin-bottom: 2.4rem;
}

.header-title h1,
.page-header h1,
.dashboard-header h1,
.settings-header h1 {
    margin: 0 0 0.55rem;

    color: var(--admin-text-strong);

    font-size: clamp(2.4rem, 3vw, 3.4rem);
    font-weight: 820;
    line-height: 1.08;
    letter-spacing: -0.045em;
    text-transform: none;
}

.header-title p,
.page-header p,
.dashboard-header p,
.settings-header p {
    max-width: 76rem;
    margin: 0;

    color: var(--admin-text-muted);

    font-size: 1.25rem;
    line-height: 1.65;
}

.header-actions,
.header-actions-group {
    gap: 0.7rem;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.button,
button.button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;

    min-height: 4rem;
    height: auto;
    margin-bottom: 0;
    padding: 0.85rem 1.3rem;

    color: #ffffff;
    background: var(--color-accent);
    border: 1px solid var(--color-accent);
    border-radius: 1rem;

    box-shadow:
        0 1px 2px rgba(16, 24, 40, 0.04);

    font-size: 1.08rem;
    font-weight: 720;
    line-height: 1.2;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: none;

    transition:
        transform 140ms ease,
        box-shadow 140ms ease,
        background-color 140ms ease,
        border-color 140ms ease,
        color 140ms ease;
}

.button:hover,
button.button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover {
    color: #ffffff;
    background:
        color-mix(
            in srgb,
            var(--color-accent) 88%,
            #000000
        );
    border-color:
        color-mix(
            in srgb,
            var(--color-accent) 88%,
            #000000
        );
    box-shadow:
        0 6px 16px
        color-mix(
            in srgb,
            var(--color-accent) 17%,
            transparent
        );
    transform: translateY(-1px);
}

.button:active,
button.button:active {
    transform: translateY(0);
}

.button:disabled,
button.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

.button-outline {
    color: var(--admin-text-strong);
    background: #ffffff;
    border-color: var(--admin-border-strong);
}

.button-outline:hover {
    color: var(--admin-text-strong);
    background: var(--admin-bg-subtle);
    border-color: #98a2b3;
    box-shadow: var(--shadow-sm);
}

.button-black {
    color: #ffffff;
    background: var(--admin-surface-dark);
    border-color: var(--admin-surface-dark);
}

.button-black:hover {
    color: #ffffff;
    background: #1d2939;
    border-color: #1d2939;
}

.button-error,
.button-danger {
    color: #ffffff;
    background: var(--admin-danger);
    border-color: var(--admin-danger);
}

.button-error:hover,
.button-danger:hover {
    color: #ffffff;
    background: #d92d20;
    border-color: #d92d20;
}

.button-clear {
    color: var(--admin-text-muted);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.button-clear:hover {
    color: var(--admin-text-strong);
    background: var(--admin-bg-subtle);
    border-color: transparent;
    box-shadow: none;
}

.button-small {
    min-height: 3.4rem;
    padding: 0.65rem 1rem;
    border-radius: 0.85rem;
    font-size: 1rem;
}

.button-large {
    min-height: 4.8rem;
    padding: 1rem 1.6rem;
    font-size: 1.15rem;
}

.button-full {
    width: 100%;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-group {
    margin-bottom: 1.8rem;
}

.form-group label,
label {
    margin-bottom: 0.55rem;

    color: var(--admin-text-strong);

    font-size: 1.08rem;
    font-weight: 680;
    letter-spacing: 0;
}

input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="url"],
select,
textarea {
    min-height: 4.3rem;
    margin-bottom: 0;
    padding: 0.9rem 1.1rem;

    color: var(--admin-text-strong);
    background: #ffffff;
    border: 1px solid var(--admin-border-strong);
    border-radius: 1rem;

    box-shadow:
        inset 0 1px 1px rgba(16, 24, 40, 0.02);

    font-size: 1.15rem;
    line-height: 1.45;

    transition:
        border-color 140ms ease,
        box-shadow 140ms ease,
        background-color 140ms ease;
}

textarea {
    min-height: 10rem;
    resize: vertical;
}

input[type="email"]:hover,
input[type="number"]:hover,
input[type="password"]:hover,
input[type="search"]:hover,
input[type="tel"]:hover,
input[type="text"]:hover,
input[type="url"]:hover,
select:hover,
textarea:hover {
    border-color: #98a2b3;
}

input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="text"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    background: #ffffff;
    border-color: var(--color-accent);
    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            var(--color-accent) 11%,
            transparent
        );
}

input::placeholder,
textarea::placeholder {
    color: #98a2b3;
}

input[readonly],
textarea[readonly],
select:disabled,
input:disabled,
textarea:disabled {
    color: var(--admin-text-muted);
    background: #f9fafb;
}

.help-text {
    margin-top: 0.5rem;

    color: var(--admin-text-muted);

    font-size: 0.98rem;
    line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Cards / Panels – ADMIN-R1.3b-2 shared surface hierarchy
   -------------------------------------------------------------------------- */

.card,
.card-table,
.perf-card,
.tool-card,
.plugin-card,
.auth-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    box-shadow: var(--admin-elevation-2);
}

.card,
.card-table {
    border-radius: var(--admin-radius-lg);
}

.card {
    position: relative;
}

.card:hover {
    border-color: var(--admin-border);
    box-shadow: var(--admin-elevation-2);
    transform: none;
}

.card-header {
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--admin-border);
}

.card-label {
    color: var(--admin-text-muted);
    font-size: 1.05rem;
    font-weight: 760;
    letter-spacing: 0.04em;
}

.card-value {
    color: var(--admin-text-strong);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.card-footer {
    color: var(--admin-text-muted);
    border-top-color: var(--admin-border);
}

/* --------------------------------------------------------------------------
   Tables – clear data surface with a CodiCraft accent edge
   -------------------------------------------------------------------------- */

.card-table,
.card:has(> table) {
    overflow: hidden;
    border-radius: var(--admin-radius-md);
}

.card-table {
    border: 0;
    border-top: 0.5rem solid var(--admin-primary);
    box-shadow: var(--admin-elevation-2);
}

.table-responsive {
    border-radius: inherit;
}

table {
    margin-bottom: 0;
    background: #ffffff;
}

table thead,
.card-table th {
    background:
        color-mix(
            in srgb,
            var(--admin-primary) 5%,
            #ffffff
        );
}

table th,
.card-table th {
    padding: 1.15rem 1.3rem;
    color: var(--admin-text-strong);
    border-bottom: 1px solid var(--admin-border);

    font-size: 0.92rem;
    font-weight: 760;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

table td,
.card-table td {
    padding: 1.15rem 1.3rem;
    color: var(--admin-text);
    border-bottom: 1px solid #eeeae3;
}

table tbody tr,
.card-table tbody tr {
    transition:
        background-color var(--admin-motion-fast) var(--admin-motion-ease);
}

table tbody tr:hover,
.card-table tbody tr:hover {
    background:
        color-mix(
            in srgb,
            var(--admin-primary) 3%,
            #ffffff
        );
}

/* --------------------------------------------------------------------------
   Badges / Status
   -------------------------------------------------------------------------- */

.badge,
.status-pill,
.badge-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;

    min-height: 2.6rem;
    padding: 0.35rem 0.7rem;

    border-radius: var(--admin-radius-pill);

    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
}

.badge-outline {
    color: var(--admin-text-muted);
    background: #ffffff;
    border: 1px solid var(--admin-border);
}

.badge-admin,
.badge-dark {
    color: #ffffff;
    background: var(--admin-surface-dark);
}

.badge-success {
    color: #067647 !important;
    background: var(--admin-success-soft) !important;
}

.badge-warning {
    color: #b54708 !important;
    background: var(--admin-warning-soft) !important;
}

.badge-error,
.badge-critical,
.badge-emergency {
    color: #b42318 !important;
    background: var(--admin-danger-soft) !important;
}

/* --------------------------------------------------------------------------
   Pagination
   ADMIN-R1.4 – one shared pagination contract for standard admin lists.
   Feature classes remain as stable hooks; layout behavior lives here.
   -------------------------------------------------------------------------- */

.cc-admin-pagination {
    align-items: center;
    gap: 0.8rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--admin-border);
}

.cc-admin-pagination strong {
    color: var(--admin-text-muted);
    font-size: 0.95rem;
}

.cc-admin-pagination--centered {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
}

.cc-admin-pagination--centered > :last-child {
    display: flex;
    justify-content: flex-end;
}

.cc-admin-pagination--split {
    display: flex;
    justify-content: space-between;
}

.cc-admin-pagination--split > :last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

@media (max-width: 650px) {
    .cc-admin-pagination--centered {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .cc-admin-pagination--centered > *,
    .cc-admin-pagination--centered > :last-child {
        justify-content: stretch;
    }

    .cc-admin-pagination--split {
        flex-direction: column;
        align-items: stretch;
    }

    .cc-admin-pagination .button {
        width: 100%;
    }
}

/* --------------------------------------------------------------------------
   Tabs / Dialog integration anchors
   ADMIN-R1.5 – specialized workspaces keep their feature layout while
   inheriting the common admin interaction/surface baseline.
   -------------------------------------------------------------------------- */

.cc-admin-tabs {
    gap: 0.5rem;
}

.cc-admin-tabs button,
.cc-admin-tabs [role="tab"] {
    min-height: 3.6rem;
}

.cc-admin-dialog {
    color: var(--admin-text-strong);
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--admin-elevation-4);
}

.cc-admin-dialog::backdrop {
    background: rgba(21, 23, 25, 0.5);
}

/* --------------------------------------------------------------------------
   Flash Messages
   -------------------------------------------------------------------------- */

.flash-container {
    top: 1.6rem;
    right: 1.6rem;
    gap: 0.8rem;
}

.flash-msg {
    min-width: min(34rem, calc(100vw - 3.2rem));
    max-width: 44rem;
    padding: 1rem 1.2rem;

    color: var(--admin-text-strong);
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 1.2rem;
    box-shadow: var(--shadow-lg);

    animation:
        adminToastIn 280ms
        cubic-bezier(0.2, 0.8, 0.2, 1)
        both;
}

.flash-msg p {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.45;
}

.flash-msg-icon {
    display: grid;
    place-items: center;
    flex: 0 0 3rem;
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    font-weight: 850;
}

.flash-success {
    color: var(--admin-text-strong);
    background: #ffffff;
    border-color: #abefc6;
}

.flash-success .flash-msg-icon {
    color: #067647;
    background: var(--admin-success-soft);
}

.flash-error {
    color: var(--admin-text-strong);
    background: #ffffff;
    border-color: #fecdca;
}

.flash-error .flash-msg-icon {
    color: #b42318;
    background: var(--admin-danger-soft);
}

.flash-anim-hide {
    opacity: 0;
    transform: translateY(-8px);
    transition:
        opacity 220ms ease,
        transform 220ms ease;
}

@keyframes adminToastIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --------------------------------------------------------------------------
   Common states
   -------------------------------------------------------------------------- */

.empty-state,
.empty-state-box,
.empty-state-table {
    color: var(--admin-text-muted);
    background: #ffffff;
    border: 1px dashed var(--admin-border-strong);
    border-radius: var(--admin-radius-md);
}

.alert,
.alert-box {
    border-radius: 1rem;
    box-shadow: var(--shadow-xs);
}

.alert-warning {
    color: #7a2e0e;
    background: var(--admin-warning-soft);
    border-color: #fedf89;
    border-left: 4px solid var(--admin-warning);
}

.alert-error {
    color: #912018;
    background: var(--admin-danger-soft);
    border-color: #fecdca;
    border-left: 4px solid var(--admin-danger);
}

/* --------------------------------------------------------------------------
   Sticky action areas
   -------------------------------------------------------------------------- */

.sticky-footer {
    border-top: 1px solid var(--admin-border);
    box-shadow:
        0 -8px 28px rgba(16, 24, 40, 0.05);
    backdrop-filter: blur(18px);
}

.form-footer-dark {
    background:
        linear-gradient(
            135deg,
            var(--admin-surface-dark),
            #172033
        );
    border-color: #1d2939;
    border-radius: var(--admin-radius-md);
}

/* --------------------------------------------------------------------------
   Auth polish
   -------------------------------------------------------------------------- */

.auth-body {
    background:
        radial-gradient(
            circle at top,
            color-mix(
                in srgb,
                var(--color-accent) 8%,
                transparent
            ),
            transparent 38rem
        ),
        var(--admin-bg);
}

.auth-card {
    border-radius: var(--admin-radius-xl);
    box-shadow: var(--shadow-xl);
}

/* --------------------------------------------------------------------------
   Mobile navigation
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .layout-sidebar {
        width: min(30rem, 88vw);
        transform: translateX(-105%);
        box-shadow: var(--shadow-xl);
    }

    body.sidebar-open .layout-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar-close-button {
        display: grid;
    }

    .layout-main {
        width: 100%;
        margin-left: 0;
    }

    .layout-header {
        padding: 0 1.6rem;
    }

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

    .breadcrumbs a:not(:last-of-type) {
        display: none;
    }

    .layout-content {
        padding:
            2rem
            clamp(1.2rem, 3vw, 2rem)
            3rem;
    }
}

@media (max-width: 640px) {
    .layout-header {
        height: 64px;
    }

    .user-info {
        display: none;
    }

    .user-avatar {
        width: 3.7rem;
        height: 3.7rem;
    }

    .breadcrumbs {
        max-width: 52vw;
    }

    .header-title h1,
    .page-header h1,
    .dashboard-header h1,
    .settings-header h1 {
        font-size: 2.45rem;
    }

    .page-header,
    .dashboard-header,
    .settings-header {
        flex-direction: column;
        gap: 1.3rem;
    }

    .header-actions,
    .header-actions-group {
        width: 100%;
        flex-wrap: wrap;
    }

    .header-actions .button,
    .header-actions-group .button {
        flex: 1 1 auto;
    }

    .flash-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .flash-msg {
        min-width: 0;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   CODICRAFT ADMIN UI 2026 - UX REFINEMENT v2
   - Desktop Sidebar Collapse
   - robuste Mobile Sidebar
   - besser lesbare Typografie auf Milligram-62.5%-Basis
   - kontraststarke Aktionen ohne Weiß-auf-Orange
   ========================================================================== */

:root {
    --sidebar-collapsed-width: 88px;

    /*
     * Theme Accent bleibt Branding-/Interaktionsfarbe.
     * Große Aktionsflächen verwenden bewusst eine stabile,
     * kontraststarke Action-Farbe.
     */
    --admin-action-bg: #b0520f;
    --admin-action-hover: #8f3f0b;
    --admin-action-text: #ffffff;
    --admin-interactive-text: #a84b0d;
}

/* --------------------------------------------------------------------------
   Lesbarkeit auf Milligram-Basis
   -------------------------------------------------------------------------- */

body {
    font-size: 1.6em;
}

.breadcrumbs {
    font-size: 1.3rem;
}

.user-name {
    font-size: 1.3rem;
}

.user-role {
    font-size: 1.05rem;
}

.header-title p,
.page-header p,
.dashboard-header p,
.settings-header p {
    font-size: 1.45rem;
}

.form-group label,
label {
    font-size: 1.3rem;
}

input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="url"],
select,
textarea {
    font-size: 1.4rem;
}

.help-text {
    font-size: 1.2rem;
}

.card-label {
    font-size: 1.1rem;
}

.card-footer {
    font-size: 1.2rem;
}

table th,
.card-table th {
    font-size: 1.08rem;
}

table td,
.card-table td {
    font-size: 1.3rem;
}

.badge,
.status-pill,
.badge-outline {
    font-size: 1.1rem;
}

.flash-msg p {
    font-size: 1.3rem;
}

/* --------------------------------------------------------------------------
   Kontraststarke Actions
   -------------------------------------------------------------------------- */

.button,
button.button,
.button-primary,
button.button-primary,
input[type="button"],
input[type="reset"],
input[type="submit"] {
    color: var(--admin-action-text);
    background: var(--admin-action-bg);
    border-color: var(--admin-action-bg);

    font-size: 1.3rem;
}

.button:hover,
button.button:hover,
.button-primary:hover,
button.button-primary:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover {
    color: var(--admin-action-text);
    background: var(--admin-action-hover);
    border-color: var(--admin-action-hover);
    box-shadow:
        0 7px 18px
        rgba(16, 24, 40, 0.16);
}

.button-outline,
button.button-outline {
    color: var(--admin-text-strong);
    background: #ffffff;
    border-color: var(--admin-border-strong);
}

.button-outline:hover,
button.button-outline:hover {
    color: var(--admin-text-strong);
    background: var(--admin-bg-subtle);
    border-color: #98a2b3;
}

.button-small {
    font-size: 1.2rem;
}

.button-large {
    font-size: 1.4rem;
}

.button-error,
.button-danger {
    color: #ffffff;
    background: #b42318;
    border-color: #b42318;
}

.button-error:hover,
.button-danger:hover {
    color: #ffffff;
    background: #912018;
    border-color: #912018;
}

/* Accent als gezielte Interaktionsfarbe statt Textfläche. */
a:not(.button),
.cc-text-button {
    text-decoration-color:
        color-mix(
            in srgb,
            var(--color-accent) 45%,
            transparent
        );
}

/* --------------------------------------------------------------------------
   Desktop Sidebar Collapse
   -------------------------------------------------------------------------- */

.sidebar-brand {
    position: relative;
    gap: 0.8rem;
}

.sidebar-brand-link {
    flex: 1 1 auto;
}

.sidebar-collapse-button {
    display: grid;
    place-items: center;
    flex: 0 0 3.2rem;
    width: 3.2rem;
    height: 3.2rem;
    margin: 0;
    padding: 0;

    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0.85rem;

    font-size: 2rem;
    line-height: 1;
    cursor: pointer;

    transition:
        color 140ms ease,
        background-color 140ms ease,
        border-color 140ms ease,
        transform 180ms ease;
}

.sidebar-collapse-button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.16);
}

body.sidebar-collapsed .layout-sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .layout-main {
    width:
        calc(
            100%
            - var(--sidebar-collapsed-width)
        );

    margin-left:
        var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-inline: 1rem;
}

body.sidebar-collapsed .sidebar-brand-link {
    flex: 0 0 auto;
}

body.sidebar-collapsed .sidebar-brand-mark {
    flex-basis: 4.4rem;
    width: 4.4rem;
    height: 4.4rem;
    border-radius: 1rem;
}

body.sidebar-collapsed .sidebar-brand-copy,
body.sidebar-collapsed .nav-link-label,
body.sidebar-collapsed .sidebar-user-copy,
body.sidebar-collapsed .sidebar-logout-form {
    display: none;
}

body.sidebar-collapsed .sidebar-nav {
    padding-inline: 0.9rem;
}

body.sidebar-collapsed .nav-link {
    justify-content: center;
    min-height: 4.8rem;
    padding-inline: 0.6rem;
}

body.sidebar-collapsed .nav-link-active {
    box-shadow:
        inset 3px 0
        var(--color-accent);
}

body.sidebar-collapsed .nav-link-icon {
    flex-basis: 3.8rem;
    width: 3.8rem;
    height: 3.8rem;
}

body.sidebar-collapsed .sidebar-footer {
    padding-inline: 0.9rem;
}

body.sidebar-collapsed .sidebar-user-card {
    justify-content: center;
    padding: 0.65rem;
}

body.sidebar-collapsed .sidebar-user-avatar {
    flex-basis: 3.8rem;
    width: 3.8rem;
    height: 3.8rem;
}

body.sidebar-collapsed .sidebar-collapse-button {
    position: absolute;
    top: 50%;
    right: -1.6rem;
    z-index: 5;

    color: var(--admin-text-strong);
    background: #ffffff;
    border-color: var(--admin-border);
    box-shadow: var(--shadow-md);

    transform: translateY(-50%);
}

/* --------------------------------------------------------------------------
   Mobile Sidebar
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    body.sidebar-collapsed .layout-sidebar,
    .layout-sidebar {
        z-index: 200;
        width: min(32rem, 88vw);
        transform: translateX(-105%) !important;
    }

    body.sidebar-open .layout-sidebar {
        transform: translateX(0) !important;
    }

    body.sidebar-collapsed .layout-main,
    .layout-main {
        width: 100%;
        margin-left: 0;
    }

    body.sidebar-collapsed .sidebar-brand-copy,
    body.sidebar-collapsed .nav-link-label,
    body.sidebar-collapsed .sidebar-user-copy,
    body.sidebar-collapsed .sidebar-logout-form {
        display: initial;
    }

    body.sidebar-collapsed .sidebar-brand-copy,
    body.sidebar-collapsed .sidebar-user-copy {
        display: flex;
    }

    body.sidebar-collapsed .sidebar-logout-form {
        display: block;
    }

    body.sidebar-collapsed .sidebar-brand {
        justify-content: flex-start;
        padding: 1.2rem 1.6rem;
    }

    body.sidebar-collapsed .sidebar-brand-link {
        flex: 1 1 auto;
    }

    body.sidebar-collapsed .sidebar-brand-mark {
        flex-basis: 3.8rem;
        width: 3.8rem;
        height: 3.8rem;
    }

    body.sidebar-collapsed .nav-link {
        justify-content: flex-start;
        padding: 0.85rem 1rem;
    }

    body.sidebar-collapsed .nav-link-icon {
        flex-basis: 3rem;
        width: 3rem;
        height: 3rem;
    }

    body.sidebar-collapsed .sidebar-user-card {
        justify-content: flex-start;
        padding: 0.8rem;
    }

    body.sidebar-collapsed .sidebar-user-avatar {
        flex-basis: 3.4rem;
        width: 3.4rem;
        height: 3.4rem;
    }

    .sidebar-collapse-button {
        display: none;
    }

    .sidebar-close-button {
        display: grid;
    }

    .sidebar-overlay {
        z-index: 190;
    }

    body.sidebar-open .sidebar-overlay {
        display: block !important;
    }

    .mobile-menu-button {
        position: relative;
        z-index: 5;
        display: block !important;
    }
}

/* ==========================================================================
   DASHBOARD – ADMIN-R1.3b-2 visual hierarchy
   ========================================================================== */

.cc-dashboard-kpis {
    display: grid;
    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );
    gap: 1.15rem;
    margin: 0 0 1.5rem;
    padding-top: 1rem;
}

.cc-dashboard-kpi,
.cc-dashboard-panel,
.cc-dashboard-widget,
.cc-dashboard-section {
    position: relative;
    background: var(--admin-surface);
    border: 1px solid color-mix(in srgb, var(--admin-border) 76%, transparent);
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-elevation-2);
}

.cc-dashboard-kpi {
    min-width: 0;
    min-height: 15.5rem;
    padding: 1.55rem 1.55rem 1.35rem;
    overflow: visible;
    transition:
        border-color var(--admin-motion-fast) var(--admin-motion-ease),
        box-shadow var(--admin-motion-fast) var(--admin-motion-ease);
}

.cc-dashboard-kpi:hover {
    border-color: var(--admin-border);
    box-shadow: var(--admin-elevation-3);
    transform: none;
}

.cc-dashboard-kpi::before {
    display: none;
}

.cc-dashboard-kpi-head {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    min-width: 0;
    min-height: 3.4rem;
}

.cc-dashboard-kpi-icon {
    display: grid;
    place-items: center;
    position: absolute;
    top: -2.25rem;
    left: 1.55rem;
    flex: 0 0 6.2rem;
    width: 6.2rem;
    height: 6.2rem;
    margin: 0;
    color: #ffffff;
    background: var(--admin-surface-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.35rem;
    box-shadow: var(--admin-elevation-3);
}

.cc-dashboard-kpi-icon.is-brand {
    background:
        linear-gradient(
            135deg,
            #e88431 0%,
            var(--admin-primary) 58%,
            #c45e12 100%
        );
    border-color:
        color-mix(
            in srgb,
            var(--admin-primary) 70%,
            #ffffff
        );
}

.cc-dashboard-kpi-icon.is-system {
    background:
        linear-gradient(
            145deg,
            #353b3e 0%,
            var(--admin-surface-dark) 72%
        );
}

.cc-dashboard-kpi-icon .cc-icon,
.cc-dashboard-quick-icon .cc-icon,
.cc-dashboard-good-icon .cc-icon,
.cc-dashboard-empty-icon .cc-icon {
    display: block;
}

.cc-dashboard-kpi-label {
    max-width: calc(100% - 6.8rem);
    min-width: 0;
    padding-top: 0.15rem;
    color: var(--admin-text-muted);
    text-align: right;
    font-size: var(--cc-admin-type-help);
    font-weight: 760;
    line-height: 1.35;
}

.cc-dashboard-kpi-value {
    display: block;
    margin: 0.75rem 0 0.9rem;
    color: var(--admin-text-strong);
    text-align: right;
    font-size: clamp(2.75rem, 3.3vw, 3.55rem);
    font-weight: 820;
    line-height: 1;
    letter-spacing: -0.045em;
}

.cc-dashboard-kpi-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    min-height: 3.1rem;
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-help);
    line-height: 1.5;
}

.cc-dashboard-kpi-meta strong {
    color: var(--admin-text-strong);
}

.cc-dashboard-card-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 1rem -0.2rem -0.1rem;
    padding: 0.9rem 0.2rem 0;
    color: var(--admin-interactive-text);
    border-top: 1px solid var(--admin-border);
    font-size: var(--cc-admin-type-help);
    font-weight: 720;
    text-decoration: none;
}

.cc-dashboard-card-link:hover {
    color: var(--admin-primary-hover);
    text-decoration: none;
}

.cc-dashboard-kpi-system::before {
    background:
        linear-gradient(
            90deg,
            var(--admin-success),
            color-mix(in srgb, var(--admin-success) 40%, transparent)
        );
}

.cc-dashboard-kpi-system.is-warning::before {
    background:
        linear-gradient(
            90deg,
            var(--admin-warning),
            color-mix(in srgb, var(--admin-warning) 42%, transparent)
        );
}

.cc-dashboard-kpi-system.is-critical::before {
    background:
        linear-gradient(
            90deg,
            var(--admin-danger),
            color-mix(in srgb, var(--admin-danger) 42%, transparent)
        );
}

.cc-dashboard-system-dot {
    position: absolute;
    right: -0.2rem;
    bottom: -0.2rem;
    width: 0.9rem;
    height: 0.9rem;
    background: var(--admin-success);
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            var(--admin-success) 12%,
            transparent
        );
}

.cc-dashboard-kpi-system.is-warning
.cc-dashboard-system-dot {
    background: var(--admin-warning);
    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            var(--admin-warning) 14%,
            transparent
        );
}

.cc-dashboard-kpi-system.is-critical
.cc-dashboard-system-dot {
    background: var(--admin-danger);
    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            var(--admin-danger) 12%,
            transparent
        );
}

.cc-dashboard-system-value {
    font-size: clamp(2rem, 2.5vw, 2.7rem);
    letter-spacing: -0.03em;
}

.cc-dashboard-section {
    margin-bottom: 1.4rem;
    padding: 1.5rem;
    overflow: hidden;
}

.cc-dashboard-panel {
    min-width: 0;
    padding: 1.5rem;
    overflow: hidden;
}

.cc-dashboard-panel::before,
.cc-dashboard-section::before {
    display: none;
}

.cc-dashboard-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: -1.5rem -1.5rem 1.35rem;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, #2b3033 0%, var(--admin-surface-dark) 100%);
    border-bottom: 0.3rem solid var(--admin-primary);
}

.cc-dashboard-panel.is-recent-pages .cc-dashboard-section-head {
    background: linear-gradient(135deg, #ed8b3c 0%, var(--admin-primary) 62%, #c45e12 100%);
    border-bottom-color: color-mix(in srgb, var(--admin-primary) 45%, #ffffff);
}

.cc-dashboard-section-head h2,
.cc-dashboard-section-head p {
    color: #ffffff;
}

.cc-dashboard-section-head p {
    opacity: 0.76;
}

.cc-dashboard-section-head .button-outline {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: none;
}

.cc-dashboard-section-head .button-outline:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.48);
}

.cc-dashboard-section-head h2 {
    margin: 0;
    color: inherit;
    font-size: var(--cc-admin-type-section-title);
    font-weight: 780;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.cc-dashboard-section-head p {
    max-width: 70rem;
    margin: 0.3rem 0 0;
    color: inherit;
    font-size: var(--cc-admin-type-help);
    line-height: 1.55;
}

.cc-dashboard-quick-actions {
    display: grid;
    grid-template-columns:
        repeat(
            5,
            minmax(0, 1fr)
        );
    gap: 0.85rem;
}

.cc-dashboard-quick-action {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
    min-height: 6.4rem;
    padding: 1rem 1.05rem;
    color: var(--admin-text-strong);
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            color-mix(in srgb, var(--admin-bg-subtle) 54%, #ffffff) 100%
        );
    border: 1px solid var(--admin-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-xs);
    text-decoration: none;
    transition:
        border-color var(--admin-motion-fast) var(--admin-motion-ease),
        box-shadow var(--admin-motion-fast) var(--admin-motion-ease);
}

.cc-dashboard-quick-action:hover {
    color: var(--admin-text-strong);
    border-color: var(--admin-border-strong);
    box-shadow: var(--admin-elevation-2);
    transform: none;
}

.cc-dashboard-quick-action.is-primary {
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--admin-primary) 9%, #ffffff) 0%,
            color-mix(in srgb, var(--admin-primary) 4%, #ffffff) 100%
        );
    border-color: var(--admin-primary-border);
}

.cc-dashboard-quick-icon {
    display: grid;
    place-items: center;
    flex: 0 0 3rem;
    width: 3rem;
    height: 3rem;
    color: var(--admin-text-strong);
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 0.9rem;
    box-shadow: var(--shadow-xs);
}

.cc-dashboard-quick-icon.is-primary {
    color: #ffffff;
    background: var(--admin-primary);
    border-color: var(--admin-primary);
}

.cc-dashboard-quick-action strong,
.cc-dashboard-quick-action small {
    display: block;
}

.cc-dashboard-quick-action strong {
    font-size: var(--cc-admin-type-body);
    line-height: 1.35;
}

.cc-dashboard-quick-action small {
    margin-top: 0.25rem;
    overflow: hidden;
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-help);
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: normal;
}

.cc-dashboard-main-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.35fr)
        minmax(20rem, 0.85fr);
    gap: 1.25rem;
    margin-bottom: 1.4rem;
}

.cc-dashboard-page-list {
    margin: 0 -1.5rem -1.5rem;
    border-top: 1px solid var(--admin-border);
}

.cc-dashboard-page-row {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto
        auto;
    align-items: center;
    gap: 0.85rem;
    min-height: 5.25rem;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid #eef1f5;
    transition: background-color var(--admin-motion-fast) var(--admin-motion-ease);
}

.cc-dashboard-page-row:hover {
    background:
        color-mix(
            in srgb,
            var(--admin-primary) 3%,
            #ffffff
        );
}

.cc-dashboard-page-row:last-child {
    border-bottom: 0;
}

.cc-dashboard-page-main {
    min-width: 0;
}

.cc-dashboard-page-title {
    display: block;
    overflow: hidden;
    color: var(--admin-text-strong);
    font-size: var(--cc-admin-type-body);
    font-weight: 720;
    line-height: 1.3;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.cc-dashboard-page-title:hover {
    color: var(--admin-primary-hover);
    text-decoration: underline;
}

.cc-dashboard-page-slug {
    display: block;
    margin-top: 0.18rem;
    overflow: hidden;
    color: var(--admin-text-soft);
    font-size: var(--cc-admin-type-help);
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-dashboard-page-time {
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-help);
    white-space: nowrap;
}

.cc-dashboard-notice-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cc-dashboard-notice {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    background: var(--admin-info-soft);
    border: 1px solid
        color-mix(
            in srgb,
            var(--admin-info) 24%,
            var(--admin-border)
        );
    border-left: 4px solid var(--admin-info);
    border-radius: 0.9rem;
}

.cc-dashboard-notice.is-warning {
    background: var(--admin-warning-soft);
    border-color:
        color-mix(
            in srgb,
            var(--admin-warning) 30%,
            var(--admin-border)
        );
    border-left-color: var(--admin-warning);
}

.cc-dashboard-notice.is-critical {
    background: var(--admin-danger-soft);
    border-color:
        color-mix(
            in srgb,
            var(--admin-danger) 26%,
            var(--admin-border)
        );
    border-left-color: var(--admin-danger);
}

.cc-dashboard-notice-copy {
    min-width: 0;
}

.cc-dashboard-notice-copy strong {
    display: block;
    color: var(--admin-text-strong);
    font-size: var(--cc-admin-type-body);
    line-height: 1.35;
}

.cc-dashboard-notice-copy p {
    margin: 0.25rem 0 0;
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-help);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.cc-dashboard-inline-form {
    display: inline-flex;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
}

.cc-dashboard-all-good {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-height: 6rem;
    padding: 1rem;
    color: #067647;
    background: var(--admin-success-soft);
    border: 1px solid
        color-mix(
            in srgb,
            var(--admin-success) 26%,
            var(--admin-border)
        );
    border-radius: 1rem;
}

.cc-dashboard-good-icon {
    display: grid;
    place-items: center;
    flex: 0 0 2.8rem;
    width: 2.8rem;
    height: 2.8rem;
    color: #ffffff;
    background: var(--admin-success);
    border-radius: 0.9rem;
    box-shadow: var(--shadow-xs);
}

.cc-dashboard-all-good strong {
    display: block;
    font-size: var(--cc-admin-type-body);
}

.cc-dashboard-all-good p {
    margin: 0.2rem 0 0;
    font-size: var(--cc-admin-type-help);
    line-height: 1.5;
}

.cc-dashboard-empty {
    display: grid;
    justify-items: center;
    min-height: 14rem;
    padding: 2rem 1rem;
    color: var(--admin-text-muted);
    text-align: center;
    background:
        linear-gradient(
            180deg,
            #ffffff,
            color-mix(in srgb, var(--admin-bg-subtle) 42%, #ffffff)
        );
    border: 1px dashed var(--admin-border-strong);
    border-radius: 1rem;
}

.cc-dashboard-empty-icon {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 0.7rem;
    color: var(--admin-primary);
    background: var(--admin-primary-soft);
    border: 1px solid var(--admin-primary-border);
    border-radius: 1rem;
}

.cc-dashboard-empty strong {
    color: var(--admin-text-strong);
    font-size: var(--cc-admin-type-body);
}

.cc-dashboard-empty p {
    margin: 0.25rem 0 0.9rem;
    font-size: var(--cc-admin-type-help);
    line-height: 1.5;
}

.cc-dashboard-widget-grid {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(18rem, 1fr)
        );
    gap: 0.9rem;
}

.cc-dashboard-widget {
    min-width: 0;
    padding: 1rem;
    background:
        linear-gradient(
            180deg,
            #ffffff,
            color-mix(in srgb, var(--admin-bg-subtle) 38%, #ffffff)
        );
}

.cc-dashboard-widget h3 {
    margin: 0 0 0.7rem;
    color: var(--admin-text-strong);
    font-size: var(--cc-admin-type-body);
    font-weight: 740;
}

.cc-dashboard-widget-content {
    color: var(--admin-text);
    font-size: var(--cc-admin-type-help);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.cc-dashboard-system-list {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(15rem, 1fr)
        );
    gap: 0;
    margin: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 1rem;
}

.cc-dashboard-system-list > div,
.cc-dashboard-system-list > div:nth-child(odd),
.cc-dashboard-system-list > div:nth-last-child(-n + 2) {
    min-width: 0;
    min-height: 5.4rem;
    padding: 1rem 1.1rem;
    background:
        linear-gradient(
            180deg,
            #ffffff,
            color-mix(in srgb, var(--admin-bg-subtle) 26%, #ffffff)
        );
    border-right: 1px solid #eef1f5;
    border-bottom: 1px solid #eef1f5;
}

.cc-dashboard-system-list dt {
    margin: 0 0 0.3rem;
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-meta);
    font-weight: 720;
    line-height: 1.35;
}

.cc-dashboard-system-list dd {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: var(--cc-admin-type-help);
    font-weight: 650;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.cc-dashboard-maintenance {
    min-width: 0;
    padding: 1rem;
    background: var(--admin-bg-subtle);
    border: 1px solid var(--admin-border);
    border-radius: 1rem;
}

.cc-dashboard-maintenance h3 {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: 1.05rem;
    font-weight: 760;
}

.cc-dashboard-maintenance > p {
    margin: 0.3rem 0 0.9rem;
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-help);
    line-height: 1.5;
}

.cc-dashboard-maintenance-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.cc-dashboard-admin-actions {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(16.5rem, 1fr)
        );
    gap: 1rem;
}

.cc-dashboard-admin-action {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    min-width: 0;
    min-height: 13.5rem;
    padding: 1.25rem;
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            color-mix(in srgb, var(--admin-bg-subtle) 55%, #ffffff) 100%
        );
    border: 1px solid var(--admin-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-xs);
}

.cc-dashboard-admin-action-copy h3 {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: 1.13rem;
    font-weight: 760;
    line-height: 1.35;
}

.cc-dashboard-admin-action-copy p {
    margin: 0.45rem 0 0;
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-help);
    line-height: 1.58;
}

.cc-dashboard-action-form {
    display: flex;
    width: 100%;
    margin: 0;
}

.cc-dashboard-action-form .button {
    width: 100%;
    min-height: 2.9rem;
    justify-content: center;
    padding: 0.72rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    white-space: normal;
}

.cc-dashboard-kpi a:focus-visible,
.cc-dashboard-quick-action:focus-visible,
.cc-dashboard-page-title:focus-visible,
.cc-dashboard-card-link:focus-visible {
    outline: 3px solid
        color-mix(
            in srgb,
            var(--admin-primary) 26%,
            transparent
        );
    outline-offset: 3px;
    border-radius: 0.55rem;
}

@media (max-width: 1180px) {
    .cc-dashboard-kpis,
    .cc-dashboard-quick-actions {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

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

@media (max-width: 720px) {
    .cc-dashboard-kpis,
    .cc-dashboard-quick-actions,
    .cc-dashboard-system-list {
        grid-template-columns: 1fr;
    }

    .cc-dashboard-kpis {
        gap: 1.8rem;
        padding-top: 1.4rem;
    }

    .cc-dashboard-kpi,
    .cc-dashboard-panel,
    .cc-dashboard-section {
        padding: 1.2rem;
    }

    .cc-dashboard-page-list {
        margin-right: -1.2rem;
        margin-bottom: -1.2rem;
        margin-left: -1.2rem;
    }

    .cc-dashboard-page-row {
        padding-right: 1.2rem;
        padding-left: 1.2rem;
    }

    .cc-dashboard-system-list > div,
    .cc-dashboard-system-list > div:nth-child(odd),
    .cc-dashboard-system-list > div:nth-last-child(-n + 2) {
        border-right: 0;
    }

    .cc-dashboard-system-list > div:last-child {
        border-bottom: 0;
    }

    .cc-dashboard-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .cc-dashboard-section-head .button {
        width: 100%;
    }

    .cc-dashboard-page-row {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    .cc-dashboard-page-time {
        grid-column: 1 / -1;
    }

    .cc-dashboard-notice {
        flex-direction: column;
    }

    .cc-dashboard-notice .button,
    .cc-dashboard-notice .cc-dashboard-inline-form {
        width: 100%;
    }

    .cc-dashboard-notice
    .cc-dashboard-inline-form
    .button {
        width: 100%;
    }

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

    .cc-dashboard-admin-action {
        min-height: 0;
    }
}

@media (max-width: 480px) {
    .cc-dashboard-kpi-value {
        font-size: 2.65rem;
    }

    .cc-dashboard-page-row {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .cc-dashboard-page-time {
        grid-column: auto;
    }

    .cc-dashboard-maintenance-actions,
    .cc-dashboard-maintenance-actions
    .cc-dashboard-inline-form,
    .cc-dashboard-maintenance-actions
    .button {
        width: 100%;
    }
}

/* ==========================================================================
   ADMIN-FARBSYSTEM
   --------------------------------------------------------------------------
   Farblogik:
   - Orange: Branding, Aktionen, Links, Fokus und Auswahl
   - Anthrazit: Sidebar / dunkle Systemflächen
   - Grün / Amber / Rot: ausschließlich semantische Statusfarben
   ========================================================================== */

/* Accessible action aliases are defined once in the authoritative UX layer above. */

/* Links verwenden eine kontraststarke CodiCraft-Interaktionsfarbe. */
body.admin-shell
a:not(.button):not(.nav-link):not(.sidebar-brand-link) {
    color: var(--admin-interactive-text);
}

body.admin-shell
a:not(.button):not(.nav-link):not(.sidebar-brand-link):hover {
    color: var(--admin-action-hover);
}

/* Fokus bleibt über alle Eingabeelemente konsistent sichtbar. */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--admin-interactive-text);
    outline-offset: 2px;
}

input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="text"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    border-color: var(--admin-primary);
    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            var(--admin-primary) 11%,
            transparent
        );
}

/* Standard-Aktionen: CodiCraft-Orange. */
.button,
button.button,
.button-primary,
button.button-primary,
input[type="button"],
input[type="reset"],
input[type="submit"] {
    color: var(--admin-action-text);
    background: var(--admin-action-bg);
    border-color: var(--admin-action-bg);
}

.button:hover,
button.button:hover,
.button-primary:hover,
button.button-primary:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover {
    color: var(--admin-action-text);
    background: var(--admin-action-hover);
    border-color: var(--admin-action-hover);
    box-shadow:
        0 7px 18px
        color-mix(
            in srgb,
            var(--admin-primary) 18%,
            transparent
        );
}

/* Neutrale Outline-Aktionen bleiben graphitfarben und erhalten nur im Hover einen warmen Brand-Akzent. */
.button-outline,
button.button-outline {
    color: var(--admin-text-strong);
    background: #ffffff;
    border-color: var(--admin-border-strong);
}

.button-outline:hover,
button.button-outline:hover {
    color: var(--admin-primary-hover);
    background: var(--admin-primary-soft);
    border-color: var(--admin-primary-border);
}

/* Dark- und Danger-Varianten behalten ihre semantische Rolle. */
.button-black,
button.button-black {
    color: #ffffff;
    background: var(--admin-surface-dark);
    border-color: var(--admin-surface-dark);
}

.button-black:hover,
button.button-black:hover {
    color: #ffffff;
    background: #1d2939;
    border-color: #1d2939;
}

.button-error,
.button-danger,
button.button-error,
button.button-danger {
    color: #ffffff;
    background: var(--admin-danger);
    border-color: var(--admin-danger);
}

.button-error:hover,
.button-danger:hover,
button.button-error:hover,
button.button-danger:hover {
    color: #ffffff;
    background: #d92d20;
    border-color: #d92d20;
}

/* Gezielte Branding-Aktion: dunkles Orange mit ausreichendem Kontrast. */
.button-accent,
button.button-accent {
    color: #ffffff;
    background: var(--admin-brand-strong);
    border-color: var(--admin-brand-strong);
}

.button-accent:hover,
button.button-accent:hover {
    color: #ffffff;
    background:
        color-mix(
            in srgb,
            var(--admin-brand-strong) 88%,
            #000000
        );
    border-color:
        color-mix(
            in srgb,
            var(--admin-brand-strong) 88%,
            #000000
        );
}

/* Branding bleibt Orange: Logo + aktive Hauptnavigation. */
.sidebar-brand-mark {
    background:
        linear-gradient(
            135deg,
            var(--admin-brand-strong),
            color-mix(
                in srgb,
                var(--admin-brand-strong) 76%,
                #000000
            )
        );

    box-shadow:
        0 8px 22px
        color-mix(
            in srgb,
            var(--admin-brand) 18%,
            transparent
        );
}

.sidebar-brand-copy strong span {
    color:
        color-mix(
            in srgb,
            var(--admin-brand) 72%,
            #ffffff
        );
}

.nav-link-active {
    background:
        linear-gradient(
            90deg,
            color-mix(
                in srgb,
                var(--admin-brand) 18%,
                transparent
            ),
            rgba(255, 255, 255, 0.045)
        );

    border-color:
        color-mix(
            in srgb,
            var(--admin-brand) 28%,
            rgba(255, 255, 255, 0.08)
        );

    box-shadow:
        inset 3px 0
        var(--admin-brand);
}

.nav-link-active .nav-link-icon {
    background:
        color-mix(
            in srgb,
            var(--admin-brand) 17%,
            rgba(255, 255, 255, 0.06)
        );
}

/* Dashboard: Interaktionen folgen der CodiCraft-Brandfarbe, Statusfarben bleiben semantisch. */
.cc-dashboard-card-link {
    color: var(--admin-interactive-text);
}

.cc-dashboard-card-link:hover {
    color: var(--admin-action-hover);
}

.cc-dashboard-quick-action.is-primary {
    background: var(--admin-primary-soft);
    border-color: var(--admin-primary-border);
}

.cc-dashboard-kpi a:focus-visible,
.cc-dashboard-quick-action:focus-visible,
.cc-dashboard-page-title:focus-visible,
.cc-dashboard-card-link:focus-visible {
    outline:
        3px solid
        color-mix(
            in srgb,
            var(--admin-primary) 26%,
            transparent
        );
}

/* Log-Navigation folgt der CodiCraft-Brandfarbe; Blau bleibt echten Info-Zustaenden vorbehalten. */
.channel-active .channel-label,
.file-active {
    color: #60a5fa;
}

.log-context pre {
    color: #93c5fd;
}

/* ==========================================================================
   EINSTELLUNGEN / SMTP / HONEYPOT
   ========================================================================== */

.cc-settings-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cc-settings-section {
    padding: 1.55rem;
}

.cc-settings-section-head {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1.35rem;
}

.cc-settings-section-head.is-split {
    justify-content: space-between;
    gap: 1.25rem;
}

.cc-settings-heading-copy {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.cc-settings-section-head h2 {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: 1.35rem;
    font-weight: 780;
    line-height: 1.3;
}

.card-dark .cc-settings-section-head h2 {
    color: #ffffff;
}

.cc-settings-section-head p {
    max-width: 70rem;
    margin: 0.3rem 0 0;
    color: var(--admin-text-muted);
    font-size: 1.02rem;
    line-height: 1.55;
}

.card-dark .cc-settings-section-head p,
.card-dark .help-text {
    color: #cbd5e1;
}

.cc-settings-info,
.cc-settings-note {
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.05rem;
    background: var(--admin-brand-soft);
    border: 1px solid var(--admin-brand-border);
    border-radius: 1rem;
}

.cc-settings-note {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}

.cc-settings-note.is-blue {
    background: var(--admin-primary-soft);
    border-color: var(--admin-primary-border);
}

.cc-settings-info strong,
.cc-settings-note strong {
    display: block;
    color: var(--admin-text-strong);
    font-size: 1.02rem;
}

.card-dark .cc-settings-note strong {
    color: #ffffff;
}

.cc-settings-info p,
.cc-settings-note p {
    margin: 0.28rem 0 0;
    color: var(--admin-text-muted);
    font-size: 0.98rem;
    line-height: 1.55;
}

.card-dark .cc-settings-note p {
    color: #cbd5e1;
}

.cc-honeypot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.cc-honeypot-panel {
    min-width: 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 1rem;
}

.cc-honeypot-panel h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.08rem;
    font-weight: 740;
}

.cc-path-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.cc-path-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.1rem;
    padding: 0.35rem 0.65rem;
    color: #dbeafe;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(147, 197, 253, 0.28);
    border-radius: 999px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
}

.cc-path-chip.is-fixed::before {
    margin-right: 0.35rem;
    content: "✓";
    color: #86efac;
}

.cc-honeypot-custom-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.cc-honeypot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    min-height: 3rem;
    padding: 0.5rem 0.55rem 0.5rem 0.8rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 0.8rem;
}

.cc-honeypot-row code {
    min-width: 0;
    overflow: hidden;
    color: #f8fafc;
    font-size: 0.94rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-honeypot-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    margin-top: 0.85rem;
}

.cc-honeypot-add input {
    margin: 0;
}

.cc-settings-empty {
    margin: 0.85rem 0 0;
    color: #cbd5e1;
    font-size: 0.96rem;
}

.cc-settings-empty.is-hidden {
    display: none;
}

.cc-settings-inline-message {
    min-height: 1.4rem;
    margin: 0.55rem 0 0;
    color: #bfdbfe;
    font-size: 0.92rem;
}

.cc-settings-inline-message.is-error {
    color: #fecaca;
}

.cc-settings-inline-message.is-success {
    color: #bbf7d0;
}

.cc-smtp-auth-toggle {
    margin-bottom: 1rem;
}

#smtp-auth-fields {
    transition: opacity 140ms ease;
}

#smtp-auth-fields.is-disabled {
    opacity: 0.48;
}

.cc-secret-status {
    display: inline-flex;
    align-items: center;
    margin: 0.3rem 0;
    padding: 0.25rem 0.6rem;
    color: #067647;
    background: var(--admin-success-soft);
    border: 1px solid color-mix(in srgb, var(--admin-success) 25%, var(--admin-border));
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
}

.cc-smtp-test-result {
    display: none;
    margin: 0 0 1rem;
    padding: 0.8rem 1rem;
    border-radius: 0.9rem;
    font-size: 0.98rem;
    line-height: 1.5;
}

.cc-smtp-test-result.is-pending,
.cc-smtp-test-result.is-success,
.cc-smtp-test-result.is-error {
    display: block;
}

.cc-smtp-test-result.is-pending {
    color: #1d4ed8;
    background: var(--admin-primary-soft);
    border: 1px solid var(--admin-primary-border);
}

.cc-smtp-test-result.is-success {
    color: #067647;
    background: var(--admin-success-soft);
    border: 1px solid color-mix(in srgb, var(--admin-success) 25%, var(--admin-border));
}

.cc-smtp-test-result.is-error {
    color: #b42318;
    background: var(--admin-danger-soft);
    border: 1px solid color-mix(in srgb, var(--admin-danger) 25%, var(--admin-border));
}

.cc-settings-save-footer {
    gap: 1rem;
}

.cc-settings-save-footer > div:first-child {
    min-width: 0;
}

.cc-settings-save-footer strong {
    color: var(--admin-text-strong);
    font-size: 1rem;
}

.cc-settings-save-footer p {
    margin: 0.2rem 0 0;
    color: var(--admin-text-muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

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

    .cc-settings-section-head.is-split {
        flex-direction: column;
        align-items: stretch;
    }

    .cc-settings-section-head.is-split .button {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .cc-settings-section {
        padding: 1.15rem;
    }

    .cc-honeypot-add {
        grid-template-columns: 1fr;
    }

    .cc-honeypot-add .button,
    .cc-honeypot-row .button {
        width: 100%;
    }

    .cc-honeypot-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .cc-settings-save-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .cc-settings-save-footer .button {
        width: 100%;
    }
}

/* ==========================================================================
   SYSTEMPROTOKOLLE
   ========================================================================== */

.cc-logs-header {
    align-items: flex-start;
    margin-bottom: 1.25rem;
    padding-bottom: 0;
    border-bottom: 0;
}

.cc-logs-header .header-title h1 {
    font-size: clamp(2rem, 2.4vw, 2.55rem);
}

.cc-logs-header .header-title p {
    max-width: 62rem;
    margin-top: 0.45rem;
    font-size: 1.06rem;
    line-height: 1.55;
}

.cc-logs-filter-card,
.cc-logs-file-card,
.cc-logs-entry-card {
    margin-bottom: 1.25rem;
    padding: 1.45rem;
}

.cc-logs-section-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.cc-logs-section-head.is-split {
    justify-content: space-between;
}

.cc-logs-section-head h2 {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: 1.3rem;
    font-weight: 780;
    line-height: 1.3;
}

.cc-logs-section-head p {
    max-width: 65rem;
    margin: 0.3rem 0 0;
    color: var(--admin-text-muted);
    font-size: 1.25rem;
    line-height: 1.55;
}

.cc-logs-filter-grid {
    display: grid;
    grid-template-columns:
        minmax(10rem, 0.7fr)
        minmax(14rem, 1.15fr)
        minmax(10rem, 0.7fr)
        minmax(10rem, 0.65fr);
    gap: 0.9rem;
    margin: 0;
}

.cc-logs-filter-grid .form-group {
    margin: 0;
}

.cc-logs-filter-grid label {
    font-size: 0.98rem;
}

.cc-logs-search-field {
    grid-column: 1 / -2;
}

.cc-logs-filter-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.65rem;
}

.cc-logs-filter-actions .button {
    min-height: 3rem;
    margin: 0;
}

.cc-logs-alert {
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--admin-border);
    border-radius: 1rem;
    font-size: 0.98rem;
    line-height: 1.55;
}

.cc-logs-alert strong {
    display: block;
    margin-bottom: 0.35rem;
}

.cc-logs-alert ul {
    margin: 0.4rem 0 0 1.2rem;
}

.cc-logs-alert.is-error {
    color: #b42318;
    background: var(--admin-danger-soft);
    border-color:
        color-mix(
            in srgb,
            var(--admin-danger) 28%,
            var(--admin-border)
        );
}

.cc-logs-alert.is-warning {
    color: #b54708;
    background: var(--admin-warning-soft);
    border-color:
        color-mix(
            in srgb,
            var(--admin-warning) 30%,
            var(--admin-border)
        );
}

.cc-logs-file-meta {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
    gap: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--admin-border);
    border-radius: 1rem;
}

.cc-logs-file-meta > div {
    min-width: 0;
    min-height: 5.2rem;
    padding: 0.9rem 1rem;
    background: #ffffff;
    border-right: 1px solid #eef1f5;
    border-bottom: 1px solid #eef1f5;
}

.cc-logs-file-meta dt {
    margin: 0 0 0.25rem;
    color: var(--admin-text-muted);
    font-size: 0.88rem;
    font-weight: 720;
}

.cc-logs-file-meta dd {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.cc-logs-file-meta code {
    color: var(--admin-primary-hover);
    background: var(--admin-primary-soft);
    border-radius: 0.35rem;
    padding: 0.15rem 0.35rem;
}

.cc-logs-delete-form {
    margin: 0;
}

.cc-logs-delete-hint {
    margin: 0.8rem 0 0;
    color: var(--admin-text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.cc-logs-entry-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.cc-log-row {
    padding: 1rem 1.05rem;
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 1rem;
}

.cc-log-row:hover {
    border-color: var(--admin-primary-border);
    box-shadow: var(--shadow-sm);
}

.cc-log-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.cc-log-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.cc-log-level,
.cc-log-channel {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: 0.22rem 0.55rem;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 780;
    letter-spacing: 0.025em;
}

.cc-log-channel {
    color: var(--admin-primary-hover);
    background: var(--admin-primary-soft);
    border-color: var(--admin-primary-border);
    text-transform: lowercase;
}

.cc-log-level.is-debug {
    color: #475467;
    background: #f2f4f7;
}

.cc-log-level.is-info {
    color: #175cd3;
    background: #eff8ff;
    border-color: #b2ddff;
}

.cc-log-level.is-notice {
    color: #344054;
    background: #f9fafb;
}

.cc-log-level.is-warning {
    color: #b54708;
    background: var(--admin-warning-soft);
    border-color: #fedf89;
}

.cc-log-level.is-error,
.cc-log-level.is-critical,
.cc-log-level.is-alert,
.cc-log-level.is-emergency {
    color: #b42318;
    background: var(--admin-danger-soft);
    border-color: #fecdca;
}

.cc-log-level.is-alert,
.cc-log-level.is-emergency {
    font-weight: 850;
}

.cc-log-time {
    color: var(--admin-text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
    white-space: nowrap;
}

.cc-log-message {
    margin: 0.75rem 0 0;
    color: var(--admin-text-strong);
    font-size: 1.04rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.cc-log-request {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
    color: var(--admin-text-muted);
    font-size: 0.9rem;
}

.cc-log-request code {
    color: var(--admin-text-strong);
    background: var(--admin-bg-subtle);
    border: 1px solid var(--admin-border);
    border-radius: 0.4rem;
    padding: 0.15rem 0.4rem;
}

.cc-log-context {
    margin-top: 0.75rem;
    padding-top: 0.7rem;
    border-top: 1px solid #eef1f5;
}

.cc-log-context summary {
    cursor: pointer;
    color: var(--admin-primary-hover);
    font-size: 0.94rem;
    font-weight: 700;
}

.cc-log-context pre {
    max-height: 28rem;
    margin: 0.7rem 0 0;
    overflow: auto;
    padding: 0.9rem;
    color: #dbeafe;
    background: var(--admin-surface-dark);
    border-radius: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.cc-logs-empty {
    display: grid;
    justify-items: center;
    min-height: 14rem;
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--admin-text-muted);
    border: 1px dashed var(--admin-border-strong);
    border-radius: 1rem;
}

.cc-logs-empty > span {
    margin-bottom: 0.7rem;
    font-size: 2.2rem;
    opacity: 0.6;
}

.cc-logs-empty strong {
    color: var(--admin-text-strong);
    font-size: 1.08rem;
}

.cc-logs-empty p {
    max-width: 34rem;
    margin: 0.3rem 0 0;
    font-size: 0.98rem;
    line-height: 1.5;
}


@media (max-width: 1050px) {
    .cc-logs-filter-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

    .cc-logs-search-field {
        grid-column: 1 / -1;
    }

    .cc-logs-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .cc-logs-file-meta {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }
}

@media (max-width: 650px) {
    .cc-logs-filter-grid,
    .cc-logs-file-meta {
        grid-template-columns: 1fr;
    }

    .cc-logs-search-field,
    .cc-logs-filter-actions {
        grid-column: auto;
    }

    .cc-logs-filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cc-logs-filter-actions .button,
    .cc-logs-delete-form,
    .cc-logs-delete-form .button {
        width: 100%;
    }

    .cc-logs-section-head.is-split {
        flex-direction: column;
        align-items: stretch;
    }

    .cc-log-row-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .cc-log-time {
        white-space: normal;
    }
}


/* ========================================================================== 
   ADMIN-UI-GRUNDVERTRAG
   Gemeinsame Darstellung für authentifizierte Admin-Ansichten.
   ========================================================================== */

.cc-admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    margin: 0 0 2rem;
}

.cc-admin-page-heading {
    min-width: 0;
}

.cc-admin-page-kicker {
    display: block;
    margin: 0 0 0.2rem;
    color: var(--admin-interactive-text);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cc-admin-page-header h1 {
    margin: 0.2rem 0 0.5rem;
    color: var(--admin-text-strong);
    font-size: clamp(2.4rem, 4vw, 3rem);
    font-weight: 820;
    line-height: 1.08;
    letter-spacing: -0.045em;
    text-transform: none;
}

.cc-admin-page-header p {
    max-width: 70rem;
    margin: 0;
    color: var(--admin-text-muted);
    font-size: 1.4rem;
    line-height: 1.6;
}

.cc-admin-page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    flex: 0 0 auto;
}

.cc-admin-page-actions form {
    margin: 0;
}

.cc-admin-section-header,
.cc-logs-section-head,
.cc-settings-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.35rem;
}

.cc-admin-section-heading {
    min-width: 0;
}

.cc-admin-section-kicker {
    display: block;
    margin-bottom: 0.18rem;
    color: var(--admin-interactive-text);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.cc-admin-section-header h2,
.cc-admin-section-header h3,
.cc-logs-section-head h2,
.cc-settings-section-head h2 {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: 1.55rem;
    font-weight: 780;
    line-height: 1.3;
    letter-spacing: -0.015em;
}

.cc-admin-section-header p,
.cc-logs-section-head p,
.cc-settings-section-head p {
    max-width: 70rem;
    margin: 0.3rem 0 0;
    color: var(--admin-text-muted);
    font-size: 1.08rem;
    line-height: 1.55;
}

.cc-admin-card-title {
    margin: 0 0 1.35rem;
    padding-bottom: 0.9rem;
    color: var(--admin-text-strong);
    border-bottom: 1px solid var(--admin-border);
    font-size: 1.45rem;
    font-weight: 760;
    line-height: 1.35;
}

.cc-admin-inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.cc-admin-inline-actions form {
    margin: 0;
}

.cc-admin-notice {
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.1rem;
    color: var(--admin-text);
    background:
        linear-gradient(
            90deg,
            var(--admin-primary-soft) 0%,
            #ffffff 72%
        );
    border: 1px solid var(--admin-primary-border);
    border-left: 4px solid var(--admin-primary);
    border-radius: 1rem;
    box-shadow: var(--shadow-xs);
}

.cc-admin-notice strong {
    display: block;
    color: var(--admin-text-strong);
    font-size: 1.05rem;
    font-weight: 760;
}

.cc-admin-notice p {
    margin: 0.3rem 0 0;
    color: var(--admin-text-muted);
    font-size: 1rem;
    line-height: 1.55;
}

/* Static admin cards are not clickable controls. */
.card:hover {
    border-color: var(--admin-border);
    box-shadow: var(--admin-elevation-2);
    transform: none;
}

/* Settings sections use a clear material header slab. Decorative status dots
 * were removed from markup; status colours are reserved for real state. */
.cc-settings-section {
    overflow: hidden;
    border: 0;
    box-shadow: var(--admin-elevation-2);
}

.cc-settings-section-head {
    margin: -1.5rem -1.5rem 1.6rem;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, #2b3033 0%, var(--admin-surface-dark) 100%);
    border-bottom: 0.3rem solid var(--admin-primary);
}

.cc-settings-section-head h2,
.cc-settings-section-head p {
    color: #ffffff;
}

.cc-settings-section-head p {
    opacity: 0.72;
}

.cc-settings-heading-copy {
    display: block;
}

/* Settings use the same light surface/contrast contract as every other page. */
.cc-settings-section.card-dark {
    color: var(--admin-text);
    background: var(--admin-surface);
    border-color: var(--admin-border);
}

.cc-settings-section.card-dark label,
.cc-settings-section.card-dark strong,
.cc-settings-section.card-dark .cc-settings-section-head h2,
.cc-settings-section.card-dark .cc-honeypot-panel h3 {
    color: var(--admin-text-strong);
}

.cc-settings-section.card-dark .cc-settings-section-head p,
.cc-settings-section.card-dark .help-text,
.cc-settings-section.card-dark .cc-settings-empty {
    color: var(--admin-text-muted);
}

.cc-settings-section .cc-honeypot-panel {
    background: var(--admin-bg-subtle);
    border-color: var(--admin-border);
}

.cc-settings-section .cc-honeypot-row {
    background: #ffffff;
    border-color: var(--admin-border);
}

.cc-settings-section .cc-honeypot-row code {
    color: var(--admin-text-strong);
}

.cc-settings-section .cc-path-chip {
    color: #1d4ed8;
    background: var(--admin-primary-soft);
    border-color: var(--admin-primary-border);
}

.cc-settings-section .cc-settings-inline-message {
    color: var(--admin-text-muted);
}

.cc-settings-section .cc-settings-inline-message.is-error {
    color: #b42318;
}

.cc-settings-section .cc-settings-inline-message.is-success {
    color: #067647;
}

/* Keep list/table actions consistent without inline layout attributes. */
.actions-cell .cc-admin-inline-actions {
    flex-wrap: nowrap;
}

.cc-table-drag-column {
    width: 40px;
}

.draggable-row.is-dragging {
    opacity: 0.4;
}

.cc-page-tree-title {
    display: flex;
    align-items: center;
    min-width: 0;
}

.cc-role-lock-icon {
    width: 1.4rem;
    height: 1.4rem;
}

@media (max-width: 760px) {
    .cc-admin-page-header {
        flex-direction: column;
        gap: 1.2rem;
    }

    .cc-admin-page-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .cc-admin-page-actions .button,
    .cc-admin-page-actions > form {
        width: 100%;
    }

    .cc-admin-page-actions > form .button {
        width: 100%;
    }

    .cc-admin-page-header h1 {
        font-size: 2.5rem;
    }
}

/* --------------------------------------------------------------------------
   Admin UI unification: module-specific normalization
   -------------------------------------------------------------------------- */

.cc-dashboard-section-head h2 {
    font-size: 1.55rem;
}

.cc-dashboard-section-head p {
    font-size: 1.08rem;
}

.cc-settings-section .cc-honeypot-panel h3 {
    color: var(--admin-text-strong);
}

.cc-settings-section .cc-settings-empty {
    color: var(--admin-text-muted);
}

.plugin-list-container {
    gap: 1.25rem;
}

.plugin-card {
    gap: 1.5rem;
    padding: 1.55rem;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--shadow-sm);
}

.plugin-active {
    border-left: 4px solid var(--admin-primary);
}

.plugin-active:hover,
.plugin-inactive:hover {
    background: var(--admin-surface);
    border-color: var(--admin-border-strong);
    box-shadow: var(--shadow-md);
    transform: none;
}

.plugin-inactive {
    opacity: 1;
    background: var(--admin-bg-subtle);
    filter: none;
}

.plugin-main-content {
    gap: 1.4rem;
}

.plugin-icon-box {
    width: 5rem;
    height: 5rem;
    background: var(--admin-bg-subtle);
    border-color: var(--admin-border);
    border-radius: 1rem;
    box-shadow: none;
    font-size: 2.4rem;
}

.plugin-title-row {
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.plugin-name {
    color: var(--admin-text-strong);
    font-size: 1.55rem;
    font-style: normal;
    font-weight: 780;
    line-height: 1.3;
    letter-spacing: -0.015em;
    text-transform: none;
}

.plugin-description {
    color: var(--admin-text-muted);
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.6;
}

.plugin-actions {
    gap: 0.7rem;
}

@media (max-width: 760px) {
    .plugin-card,
    .plugin-main-content {
        align-items: flex-start;
    }

    .plugin-main-content {
        width: 100%;
    }

    .plugin-actions {
        width: 100%;
    }
}

/* --------------------------------------------------------------------------
   Plugin administration: stable upload controls and explicit actions
   -------------------------------------------------------------------------- */

.cc-plugin-upload-form {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0;
}

.cc-plugin-file-picker {
    position: relative;
    flex: 0 0 14rem;
    width: 14rem;
    min-width: 0;
}

.cc-plugin-file-picker input[type="file"] {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.cc-plugin-file-button {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cc-plugin-file-picker:focus-within .cc-plugin-file-button {
    color: var(--admin-primary-hover);
    background: var(--admin-primary-soft);
    border-color: var(--admin-primary-border);
    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            var(--admin-primary) 11%,
            transparent
        );
}

@media (max-width: 760px) {
    .cc-plugin-upload-form {
        width: 100%;
        flex-wrap: wrap;
    }

    .cc-plugin-file-picker {
        flex: 1 1 14rem;
        width: auto;
    }

    .cc-plugin-upload-form > .button {
        flex: 1 1 auto;
    }
}

/* ========================================================================== 
   SYSTEMDIAGNOSE
   ========================================================================== */

.cc-health-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(32rem, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1.35rem;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-left: 4px solid var(--admin-success);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--shadow-sm);
}

.cc-health-overview.is-warning {
    border-left-color: var(--admin-warning);
}

.cc-health-overview.is-critical {
    border-left-color: var(--admin-danger);
}

.cc-health-overview-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.cc-health-overview-dot,
.cc-health-check-dot {
    display: inline-block;
    flex: 0 0 auto;
    width: 0.8rem;
    height: 0.8rem;
    background: var(--admin-success);
    border-radius: 999px;
    box-shadow: 0 0 0 0.45rem var(--admin-success-soft);
}

.cc-health-overview.is-warning .cc-health-overview-dot,
.cc-health-check.is-warning .cc-health-check-dot {
    background: var(--admin-warning);
    box-shadow: 0 0 0 0.45rem var(--admin-warning-soft);
}

.cc-health-overview.is-critical .cc-health-overview-dot,
.cc-health-check.is-critical .cc-health-check-dot {
    background: var(--admin-danger);
    box-shadow: 0 0 0 0.45rem var(--admin-danger-soft);
}

.cc-health-overview-kicker {
    display: block;
    margin-bottom: 0.15rem;
    color: var(--admin-text-muted);
    font-size: 1.05rem;
    font-weight: 760;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.cc-health-overview-main strong {
    display: block;
    color: var(--admin-text-strong);
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.25;
}

.cc-health-checked-at {
    display: block;
    margin-top: 0.35rem;
    color: var(--admin-text-muted);
    font-size: 1.2rem;
}

.cc-health-summary-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0;
}

.cc-health-summary-stats > div {
    min-width: 0;
    padding: 0.8rem 0.9rem;
    background: var(--admin-bg-subtle);
    border: 1px solid var(--admin-border);
    border-radius: 0.9rem;
}

.cc-health-summary-stats dt {
    margin: 0;
    color: var(--admin-text-muted);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
}

.cc-health-summary-stats dd {
    margin: 0.25rem 0 0;
    color: var(--admin-text-strong);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
}

.cc-health-readonly-notice {
    margin-bottom: 1.75rem;
}

.cc-health-readonly-notice p {
    margin: 0;
}

.cc-health-groups {
    display: grid;
    gap: 1.5rem;
}

.cc-health-section {
    padding: 1.35rem;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--shadow-sm);
}

.cc-health-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.cc-health-check {
    min-width: 0;
    padding: 1rem 1.05rem;
    background: var(--admin-bg-subtle);
    border: 1px solid var(--admin-border);
    border-radius: 1rem;
}

.cc-health-check.is-notice {
    border-color: color-mix(in srgb, var(--admin-info) 30%, var(--admin-border));
}

.cc-health-check.is-warning {
    border-color: color-mix(in srgb, var(--admin-warning) 34%, var(--admin-border));
}

.cc-health-check.is-critical {
    border-color: color-mix(in srgb, var(--admin-danger) 34%, var(--admin-border));
}

.cc-health-check-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.cc-health-check-heading {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.cc-health-check-heading h3 {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: 1.35rem;
    font-weight: 760;
    line-height: 1.35;
}

.cc-health-check-dot {
    width: 0.62rem;
    height: 0.62rem;
    box-shadow: 0 0 0 0.32rem var(--admin-success-soft);
}

.cc-health-check.is-notice .cc-health-check-dot {
    background: var(--admin-info);
    box-shadow: 0 0 0 0.32rem var(--admin-info-soft);
}

.cc-health-check.is-warning .cc-health-check-dot {
    box-shadow: 0 0 0 0.32rem var(--admin-warning-soft);
}

.cc-health-check.is-critical .cc-health-check-dot {
    box-shadow: 0 0 0 0.32rem var(--admin-danger-soft);
}

.cc-health-status-badge {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 2.2rem;
    padding: 0.35rem 0.65rem;
    color: #067647;
    background: var(--admin-success-soft);
    border: 1px solid color-mix(in srgb, var(--admin-success) 28%, var(--admin-border));
    border-radius: 999px;
    font-size: 1.1rem;
    font-weight: 760;
    line-height: 1;
}

.cc-health-status-badge.is-notice {
    color: #24546f;
    background: var(--admin-info-soft);
    border-color: color-mix(in srgb, var(--admin-info) 30%, var(--admin-border));
}

.cc-health-status-badge.is-warning {
    color: #b54708;
    background: var(--admin-warning-soft);
    border-color: color-mix(in srgb, var(--admin-warning) 30%, var(--admin-border));
}

.cc-health-status-badge.is-critical {
    color: #b42318;
    background: var(--admin-danger-soft);
    border-color: color-mix(in srgb, var(--admin-danger) 30%, var(--admin-border));
}

.cc-health-check-value {
    display: block;
    margin-top: 0.95rem;
    color: var(--admin-text-strong);
    font-size: 1.35rem;
    font-weight: 760;
    line-height: 1.4;
}

.cc-health-check-description {
    margin: 0.4rem 0 0;
    color: var(--admin-text-muted);
    font-size: 1.25rem;
    line-height: 1.55;
}

.cc-health-check-detail {
    margin-top: 0.8rem;
    padding-top: 0.7rem;
    color: var(--admin-text-muted);
    border-top: 1px solid var(--admin-border);
    font-size: 1.15rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .cc-health-overview {
        grid-template-columns: 1fr;
    }

    .cc-health-summary-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .cc-health-check-grid {
        grid-template-columns: 1fr;
    }

    .cc-health-summary-stats {
        grid-template-columns: 1fr 1fr;
    }

    .cc-health-check-head {
        flex-direction: column;
    }
}


/* ========================================================================== */
/* Release UI consistency: Auth + reference plugin                            */
/* ========================================================================== */

.auth-header .auth-brand-mark {
    width: 4.8rem;
    height: 4.8rem;
    margin: 0 auto 1.4rem;
    display: grid;
    place-items: center;
    border-radius: 1.35rem;
    background: var(--admin-surface-dark);
    color: var(--admin-text-inverse);
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    box-shadow: var(--shadow-md);
}

.auth-kicker {
    margin: 0 0 0.65rem;
    color: var(--admin-brand-strong);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-title {
    font-size: clamp(2.4rem, 4vw, 3.2rem);
    letter-spacing: -0.035em;
}

.auth-subtitle {
    max-width: 46rem;
    margin-inline: auto;
    font-size: 1.45rem;
    line-height: 1.6;
}

.auth-card .btn-auth {
    min-height: 4.6rem;
    justify-content: center;
}

.cc-plugin-test-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.8rem;
    margin-bottom: 1.8rem;
}

.cc-plugin-test-meta {
    margin: 0;
}

.cc-plugin-test-meta > div {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--admin-border);
}

.cc-plugin-test-meta > div:last-child { border-bottom: 0; }
.cc-plugin-test-meta dt { color: var(--admin-text-muted); font-weight: 700; }
.cc-plugin-test-meta dd { margin: 0; color: var(--admin-text-strong); font-weight: 700; text-align: right; }
.cc-plugin-test-message { margin: 0; font-size: 1.55rem; line-height: 1.65; color: var(--admin-text-strong); }
.cc-plugin-test-contract { margin-top: 0; }
.cc-plugin-test-settings-card { max-width: 78rem; }

@media (max-width: 760px) {
    .cc-plugin-test-grid { grid-template-columns: 1fr; }
}

/* ========================================================================== */

/* Recovery status ---------------------------------------------------------- */
.flash-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
    border-left: 6px solid #f59e0b;
}

.cc-update-recovery-summary {
    margin: 0 0 2.2rem;
    border: 1px solid var(--admin-border);
    border-radius: 1.4rem;
    overflow: hidden;
    background: var(--admin-surface);
}

.cc-update-recovery-summary > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 1.2rem;
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid var(--admin-border);
}

.cc-update-recovery-summary > div:last-child {
    border-bottom: 0;
}

.cc-update-recovery-summary dt,
.cc-update-recovery-summary dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.cc-update-recovery-summary dt {
    color: var(--admin-text-muted);
    font-size: 1.2rem;
    font-weight: 700;
}

.cc-update-recovery-summary dd {
    color: var(--admin-text);
    font-size: 1.3rem;
    font-weight: 700;
}

@media (max-width: 640px) {
    .cc-update-recovery-summary > div {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }
}

/* Auth responsive contract                                                   */
/* ========================================================================== */

.auth-body {
    min-width: 0;
    min-height: 100dvh;
    padding: clamp(1.2rem, 3vw, 2.4rem);
    overflow-x: hidden;
}

.auth-wrapper {
    width: 100%;
    min-width: 0;
    padding: 0;
}

.auth-page {
    width: min(100%, 58rem);
    min-width: 0;
    margin: 0 auto;
}

.auth-page--wide {
    width: min(100%, 76rem);
}

.auth-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: clamp(2.6rem, 5vw, 5rem);
}

.auth-form,
.auth-form .form-group,
.auth-form input,
.auth-form select,
.auth-form textarea,
.auth-form button {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
    width: 100%;
}

.auth-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.8rem;
}

.auth-secondary-action {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem 0.8rem;
    margin-bottom: 1.4rem;
    color: var(--admin-text-muted);
    font-size: 1.3rem;
}

.auth-secondary-action a {
    font-weight: 750;
}

.auth-copyright {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .auth-body {
        align-items: flex-start;
        padding:
            max(1.2rem, env(safe-area-inset-top))
            max(1.2rem, env(safe-area-inset-right))
            max(1.2rem, env(safe-area-inset-bottom))
            max(1.2rem, env(safe-area-inset-left));
    }

    .auth-card {
        padding: 2.6rem 1.6rem 2.2rem;
        border-radius: 1.6rem;
    }

    .auth-header {
        margin-bottom: 2.6rem;
    }

    .auth-header .auth-brand-mark {
        width: 4.2rem;
        height: 4.2rem;
        margin-bottom: 1.1rem;
    }

    .auth-title {
        font-size: clamp(2.2rem, 8vw, 2.8rem);
        overflow-wrap: anywhere;
    }

    .auth-subtitle {
        font-size: 1.35rem;
        line-height: 1.55;
    }

    .auth-field-grid,
    .checklist-grid {
        grid-template-columns: 1fr;
    }

    .password-label-wrapper {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 0.6rem 1rem;
    }

    .forgot-password-link {
        font-size: 1.2rem;
    }

    .flash-box {
        padding: 1.3rem 1.4rem;
        margin-bottom: 2rem;
        font-size: 1.2rem;
        overflow-wrap: anywhere;
    }

    .pw-checklist-box {
        padding: 1.7rem;
        margin: 1.2rem 0 2.4rem;
        border-radius: 1.4rem;
    }

    .btn-auth {
        min-height: 4.8rem;
        height: auto;
        padding: 1.2rem 1.4rem;
        letter-spacing: 0.12em;
    }

    .auth-footer {
        margin-top: 2.8rem;
    }
}

/* ========================================================================== 
   Permission E2E / Admin UI follow-up - 2026-08-20
   ========================================================================== */

/* Settings section titles stay aligned with the rest of the admin UI. */
.cc-settings-section-head:not(.is-split) {
    justify-content: flex-start;
}

.cc-settings-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.cc-settings-fieldset[disabled] {
    opacity: 1;
}

.cc-settings-fieldset[disabled] input,
.cc-settings-fieldset[disabled] select,
.cc-settings-fieldset[disabled] textarea,
.cc-settings-fieldset[disabled] button,
.cc-settings-fieldset[disabled] .toggle-slider {
    cursor: not-allowed;
}

/* Keep toggle copy and the switch from competing for horizontal space. */
.toggle-row {
    gap: 1.25rem;
}

.toggle-row > div {
    flex: 1 1 auto;
    min-width: 0;
}

.toggle-switch {
    flex: 0 0 54px;
}


/* Theme/language selects share one visual baseline despite different help copy. */
.cc-settings-theme-grid .help-text {
    min-height: 4.1rem;
}

.cc-settings-save-footer {
    justify-content: flex-end;
}

/* Permission matrix: make the concrete capability behind every checkbox visible. */
.capability-cell-label {
    display: block;
    max-width: 100%;
    margin-top: 0.35rem;
    color: var(--admin-text-soft);
    font-size: 0.78rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
    white-space: normal;
}

/* Logs: the search field gives the action buttons a dedicated column. */
.cc-logs-filter-grid {
    grid-template-columns:
        repeat(3, minmax(0, 1fr))
        minmax(22rem, auto);
}

.cc-logs-search-field {
    grid-column: 1 / span 3;
    min-width: 0;
}

.cc-logs-filter-actions {
    grid-column: 4;
    min-width: 0;
}

.cc-logs-filter-actions .button {
    white-space: nowrap;
}

/* Dashboard maintenance copy should remain comfortably readable on desktop. */
.cc-dashboard-admin-action-copy h3 {
    font-size: 1.32rem;
}

.cc-dashboard-admin-action-copy p {
    font-size: 1.14rem;
    line-height: 1.62;
}

.cc-dashboard-action-form .button {
    font-size: 1.08rem;
}

/* Plugin lifecycle actions use one compact action rhythm. */
.plugin-actions .button {
    min-height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1250px) {
    .cc-logs-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cc-logs-search-field,
    .cc-logs-filter-actions {
        grid-column: 1 / -1;
    }

    .cc-logs-filter-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .cc-settings-theme-grid .help-text {
        min-height: 0;
    }

    .toggle-row {
        align-items: flex-start;
    }

    .toggle-switch {
        margin-top: 0.1rem;
    }
}

@media (max-width: 650px) {
    .cc-logs-filter-grid {
        grid-template-columns: 1fr;
    }

    .cc-logs-search-field,
    .cc-logs-filter-actions {
        grid-column: auto;
    }

    .cc-logs-filter-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
}

/* ========================================================================== 
   USER LIST FILTERS / PAGINATION
   ========================================================================== */

.cc-users-filter-card {
    margin-bottom: 1.25rem;
}

.cc-users-section-head {
    margin-bottom: 1rem;
}

.cc-users-section-head h2 {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: 1.3rem;
    font-weight: 780;
    line-height: 1.3;
}

.cc-users-section-head p {
    max-width: 65rem;
    margin: 0.3rem 0 0;
    color: var(--admin-text-muted);
    font-size: 1.05rem;
    line-height: 1.55;
}

.cc-users-filter-grid {
    display: grid;
    grid-template-columns:
        minmax(16rem, 1.5fr)
        minmax(11rem, 0.8fr)
        minmax(11rem, 0.8fr)
        minmax(8rem, 0.5fr)
        auto;
    gap: 0.9rem;
    align-items: end;
    margin: 0;
}

.cc-users-filter-grid .form-group {
    margin: 0;
}

.cc-users-filter-grid label {
    font-size: 0.98rem;
}

.cc-users-filter-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.65rem;
}

.cc-users-filter-actions .button {
    min-height: 3rem;
    margin: 0;
}

.table-actions-cell {
    min-width: 120px;
}

.inline-action-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

.inline-action-form .btn-icon {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.cc-users-list-footer {
    display: grid;
    gap: 1rem;
}

.cc-users-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}


@media (max-width: 1100px) {
    .cc-users-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cc-users-search-field,
    .cc-users-filter-actions {
        grid-column: 1 / -1;
    }

    .cc-users-filter-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 650px) {
    .cc-users-filter-grid {
        grid-template-columns: 1fr;
    }

    .cc-users-search-field,
    .cc-users-filter-actions {
        grid-column: auto;
    }

    .cc-users-filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cc-users-filter-actions .button {
        width: 100%;
    }
}

/* Security / Database Inspector */
.cc-security-readonly,
.cc-security-alert {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color, #dfe3e8);
    border-radius: 0.75rem;
    background: var(--surface-muted, #f7f8fa);
}

.cc-security-readonly strong {
    flex: 0 0 auto;
}

.cc-security-alert.is-error {
    display: block;
}

.cc-security-alert ul {
    margin: 0.65rem 0 0 1.25rem;
}

.cc-security-section {
    margin-bottom: 2rem;
}

.cc-security-section-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.cc-security-section-head.is-compact {
    margin-bottom: 0.75rem;
}

.cc-security-section-head h2,
.cc-security-section-head h3,
.cc-security-section-head p {
    margin-top: 0;
}

.cc-security-section-head p {
    margin-bottom: 0;
}

.cc-security-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.cc-security-metric {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.cc-security-metric span,
.cc-security-client-ip span,
.cc-security-client-ip small {
    color: var(--text-muted, #667085);
}

.cc-security-metric strong,
.cc-security-client-ip strong {
    overflow-wrap: anywhere;
}

.cc-security-detail-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
}

.cc-security-detail-list > div {
    min-width: 0;
}

.cc-security-detail-list dt {
    margin-bottom: 0.25rem;
    color: var(--text-muted, #667085);
}

.cc-security-detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.cc-security-filter-card,
.cc-security-schema-card,
.cc-security-migration-card,
.cc-security-client-ip {
    margin-bottom: 1rem;
}

.cc-security-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: end;
}

.cc-security-filter-grid .form-group {
    margin-bottom: 0;
}

.cc-security-search-field {
    grid-column: span 2;
}

.cc-security-filter-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cc-security-index-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.cc-security-index-list article {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color, #dfe3e8);
    border-radius: 0.65rem;
}

.cc-security-index-list article > span {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-muted, #667085);
}

.cc-security-code-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.cc-security-client-ip {
    display: grid;
    gap: 0.35rem;
}


@media (max-width: 64rem) {
    .cc-security-metric-grid,
    .cc-security-detail-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 40rem) {
    .cc-security-readonly,
    .cc-security-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .cc-security-metric-grid,
    .cc-security-detail-list,
    .cc-security-filter-grid {
        grid-template-columns: 1fr;
    }

    .cc-security-search-field {
        grid-column: auto;
    }

    .cc-security-filter-actions,
    .cc-security-filter-actions .button {
        width: 100%;
    }
}


/* Security-Operations: kontrollierte manuelle Hardblocks */
.cc-security-block-form {
    margin-bottom: 1.5rem;
}

.cc-security-block-form-grid {
    display: grid;
    grid-template-columns: minmax(15rem, 0.8fr) minmax(20rem, 1.5fr) auto;
    gap: 1rem;
    align-items: end;
}

.cc-security-block-form-grid .form-group {
    margin-bottom: 0;
}

.cc-security-block-reason textarea {
    min-height: 6.5rem;
    resize: vertical;
}

.cc-security-block-submit {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.cc-security-block-submit small {
    max-width: 18rem;
}

@media (max-width: 900px) {
    .cc-security-block-form-grid {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .cc-security-block-submit,
    .cc-security-block-submit .button {
        width: 100%;
    }
}


/* ==========================================================================
   ADMIN-R1.3b-3 / part 2 – Forms, users, roles, plugins, security and logs
   Shared feature surfaces follow the accepted graphite/orange material system.
   ========================================================================== */

.cc-admin-form-card,
.cc-admin-surface-card,
.cc-admin-filter-card,
.cc-admin-list-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--admin-elevation-2);
    transform: none;
}

.cc-admin-form-card:hover,
.cc-admin-surface-card:hover,
.cc-admin-filter-card:hover,
.cc-admin-list-card:hover {
    border-color: var(--admin-border);
    box-shadow: var(--admin-elevation-2);
    transform: none;
}

.cc-admin-form-card {
    overflow: hidden;
}

.cc-admin-form-card > .card-title {
    margin: -1.5rem -1.5rem 1.5rem;
    padding: 1.1rem 1.5rem;
    color: #ffffff;
    background: var(--cc-panel-header-bg, var(--admin-surface-dark));
    border: 0;
    border-bottom: 0.3rem solid var(--admin-primary);
    font-size: 1.35rem;
    font-weight: 780;
    line-height: 1.35;
}

.cc-admin-muted-card {
    background: var(--admin-bg-subtle);
}

.cc-admin-danger-surface {
    border-color: color-mix(in srgb, #b42318 24%, var(--admin-border));
}

.cc-admin-danger-surface > .card-body > .alert-warning,
.cc-admin-danger-surface > .alert-warning {
    margin-top: 0;
}

.cc-admin-form-actions,
.form-footer-dark.cc-admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem 1.1rem;
    color: var(--admin-text);
    background: var(--cc-action-dock-bg, var(--admin-surface));
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--admin-elevation-2);
}

.cc-admin-form-actions .button,
.form-footer-dark.cc-admin-form-actions .button {
    margin: 0;
}

.cc-admin-filter-card {
    overflow: hidden;
    border-top: 0.3rem solid var(--admin-primary);
}

.cc-admin-list-card {
    overflow: hidden;
}

.cc-admin-surface-card {
    overflow: hidden;
}

.cc-admin-metric-card {
    min-height: 8.2rem;
    padding: 1.25rem 1.35rem;
    border-top: 0.3rem solid var(--admin-primary);
}

.cc-admin-metric-card > span {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.cc-admin-metric-card > strong {
    color: var(--admin-text-strong);
    font-size: 1.45rem;
    line-height: 1.25;
}

.cc-inline-icon {
    display: inline-block;
    flex: 0 0 auto;
    margin-right: 0.28rem;
    vertical-align: -0.12em;
}

.cc-icon--xs {
    width: 1.35rem;
    height: 1.35rem;
}

.cc-icon--back {
    transform: rotate(180deg);
}

.cc-empty-state-icon {
    display: inline-flex;
    width: 4.6rem;
    height: 4.6rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
    color: #ffffff;
    background: var(--cc-panel-header-bg, var(--admin-surface-dark));
    border-radius: 1.2rem;
    box-shadow: var(--admin-elevation-2);
}

.cc-empty-state-icon .cc-icon {
    width: 2.4rem;
    height: 2.4rem;
}

.cc-icon-button,
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cc-icon-button {
    width: 3.2rem;
    min-width: 3.2rem;
    padding-inline: 0;
}

.btn-icon {
    color: var(--admin-text-strong);
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    box-shadow: none;
}

.btn-icon:hover,
.btn-icon:focus-visible {
    color: var(--admin-primary-hover);
    background: var(--admin-primary-soft);
    border-color: var(--admin-primary-border);
    box-shadow: none;
    transform: none;
}

.btn-icon-danger:hover,
.btn-icon-danger:focus-visible {
    color: #b42318;
    background: color-mix(in srgb, #b42318 8%, #ffffff);
    border-color: color-mix(in srgb, #b42318 26%, var(--admin-border));
}

.btn-icon-disabled {
    color: var(--admin-text-soft);
    background: var(--admin-bg-subtle);
    border-color: var(--admin-border);
}

.cc-users-filter-card,
.cc-logs-filter-card,
.cc-security-filter-card {
    padding-top: 1.35rem;
}

.cc-users-section-head,
.cc-logs-section-head,
.cc-security-section-head {
    position: relative;
}

.cc-users-section-head h2,
.cc-logs-section-head h2,
.cc-security-section-head h2,
.cc-security-section-head h3 {
    color: var(--admin-text-strong);
}

.cc-users-section-head p,
.cc-logs-section-head p,
.cc-security-section-head p {
    color: var(--admin-text-muted);
}

.cc-plugin-section {
    border-top: 0.3rem solid var(--admin-primary);
}

.cc-plugin-section-head {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--admin-border);
}

.cc-plugin-section-footer {
    margin: 1.25rem -1.5rem -1.5rem;
    padding: 1rem 1.5rem;
    background: var(--admin-bg-subtle);
    border-top: 1px solid var(--admin-border);
}

.cc-plugin-secret-card > .cc-admin-section-head {
    margin: -1.5rem -1.5rem 1.5rem;
    padding: 1.1rem 1.5rem;
    background: var(--cc-panel-header-bg, var(--admin-surface-dark));
    border-bottom: 0.3rem solid var(--admin-primary);
}

.cc-plugin-secret-card > .cc-admin-section-head h2,
.cc-plugin-secret-card > .cc-admin-section-head p,
.cc-plugin-secret-card > .cc-admin-section-head code {
    color: #ffffff;
}

.cc-plugin-secret-card > .cc-admin-section-head p {
    opacity: 0.76;
}

.cc-plugin-secret-card details {
    margin-top: 0.9rem;
}

.cc-plugin-secret-card details > summary.button {
    display: inline-flex;
    list-style: none;
    cursor: pointer;
}

.cc-plugin-secret-card details > summary.button::-webkit-details-marker {
    display: none;
}

.cc-security-readonly {
    color: var(--admin-text);
    background: var(--admin-bg-subtle);
    border-color: var(--admin-border);
    border-left: 0.3rem solid var(--admin-primary);
}

.cc-security-alert.is-error,
.cc-logs-alert.is-error {
    border-left-width: 0.3rem;
}

.cc-log-row {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 0.9rem;
    box-shadow: var(--shadow-xs);
}

.cc-log-row:hover {
    background: var(--admin-bg-subtle);
    border-color: var(--admin-border-strong);
    box-shadow: var(--shadow-xs);
    transform: none;
}

.cc-health-check.cc-admin-surface-card {
    border-left-width: 1px;
}

.cc-admin-legacy-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    margin: 0 0 2rem;
    padding: 0 0 1.25rem;
    border-bottom: 1px solid var(--admin-border);
}

.cc-admin-legacy-page-header h1 {
    margin: 0.2rem 0 0.45rem;
    color: var(--admin-text-strong);
}

.cc-admin-legacy-page-header .eyebrow {
    color: var(--admin-interactive-text);
}

@media (max-width: 760px) {
    .cc-admin-form-actions,
    .form-footer-dark.cc-admin-form-actions,
    .cc-admin-legacy-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .cc-admin-form-actions .button,
    .form-footer-dark.cc-admin-form-actions .button,
    .cc-admin-legacy-page-header .button {
        width: 100%;
    }
}

/* ========================================================================== 
   ADMIN-TYPOGRAFIE
   Gemeinsame Schriftgrößen für authentifizierte Admin-Ansichten.
   ========================================================================== */

:root {
    --cc-admin-type-page-subtitle: 1.4rem;
    --cc-admin-type-section-title: 1.55rem;
    --cc-admin-type-card-title: 1.35rem;
    --cc-admin-type-body: 1.3rem;
    --cc-admin-type-help: 1.2rem;
    --cc-admin-type-meta: 1.1rem;
}

.cc-admin-page-header p {
    font-size: var(--cc-admin-type-page-subtitle);
}

.cc-admin-section-header h2,
.cc-admin-section-header h3,
.cc-logs-section-head h2,
.cc-settings-section-head h2,
.cc-dashboard-section-head h2,
.cc-security-section-head h2 {
    font-size: var(--cc-admin-type-section-title);
}

.cc-admin-section-header p,
.cc-logs-section-head p,
.cc-settings-section-head p,
.cc-dashboard-section-head p,
.cc-security-section-head p {
    font-size: var(--cc-admin-type-help);
    line-height: 1.6;
}

.form-group label,
.cc-logs-filter-grid label,
.cc-users-filter-grid label,
.cc-security-filter-grid label,
.cc-security-block-form-grid label {
    font-size: var(--cc-admin-type-body);
}

.help-text,
.cc-admin-notice p,
.cc-health-check-detail,
.cc-security-client-ip small,
.cc-security-block-submit small {
    font-size: var(--cc-admin-type-help);
}

.cc-admin-notice strong {
    font-size: var(--cc-admin-type-body);
}

/* Dashboard: same readable hierarchy as Settings instead of compact widget text. */
.cc-dashboard-kpi-label,
.cc-dashboard-kpi-meta,
.cc-dashboard-card-link {
    font-size: var(--cc-admin-type-help);
}

.cc-dashboard-quick-action strong,
.cc-dashboard-page-title,
.cc-dashboard-notice-copy strong,
.cc-dashboard-all-good strong,
.cc-dashboard-empty strong {
    font-size: var(--cc-admin-type-body);
}

.cc-dashboard-quick-action small,
.cc-dashboard-page-slug,
.cc-dashboard-page-time,
.cc-dashboard-notice-copy p,
.cc-dashboard-all-good p,
.cc-dashboard-empty p,
.cc-dashboard-widget-content,
.cc-dashboard-system-list dd,
.cc-dashboard-admin-action-copy p {
    font-size: var(--cc-admin-type-help);
}

.cc-dashboard-widget h3,
.cc-dashboard-admin-action-copy h3 {
    font-size: var(--cc-admin-type-card-title);
}

.cc-dashboard-system-list dt {
    font-size: var(--cc-admin-type-meta);
}

.cc-dashboard-action-form .button {
    font-size: var(--cc-admin-type-help);
}

/* Security inspector follows the same content scale. */
.cc-security-section-head h3,
.cc-security-metric strong,
.cc-security-client-ip strong,
.cc-security-detail-list dd {
    font-size: var(--cc-admin-type-body);
}

.cc-security-metric span,
.cc-security-client-ip span,
.cc-security-detail-list dt,
.cc-security-index-list article > span {
    font-size: var(--cc-admin-type-help);
}

/* ========================================================================== 
   PLUGIN / MODULE MANAGEMENT UNIFICATION v2
   Treat installed modules as standard admin cards with explicit actions.
   ========================================================================== */

.plugin-list-container {
    gap: 1rem;
}

.plugin-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.25rem;
    padding: 1.35rem 1.5rem;
    border-radius: var(--admin-radius-md);
    box-shadow: var(--shadow-sm);
}

.plugin-card.card:hover {
    border-color: var(--admin-border-strong);
    box-shadow: var(--shadow-sm);
}

.plugin-active {
    border-left: 3px solid var(--admin-primary);
}

.plugin-inactive {
    background: var(--admin-bg-subtle);
}

.plugin-main-content {
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
}

.plugin-icon-box {
    flex: 0 0 4.2rem;
    width: 4.2rem;
    height: 4.2rem;
    border-radius: 0.9rem;
    font-size: 2rem;
}

.plugin-details {
    min-width: 0;
}

.plugin-title-row {
    gap: 0.7rem;
    margin-bottom: 0.35rem;
}

.plugin-name {
    font-size: var(--cc-admin-type-section-title);
}

.plugin-description {
    font-size: var(--cc-admin-type-body);
    line-height: 1.55;
}

.plugin-author {
    margin: 0.3rem 0 0;
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-help);
    line-height: 1.45;
}

.plugin-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.plugin-error-box {
    margin-top: 0.9rem;
    padding: 0.85rem 1rem;
    color: #912018;
    background: var(--admin-danger-soft);
    border: 1px solid #fecdca;
    border-radius: 0.9rem;
    font-size: var(--cc-admin-type-help);
    line-height: 1.5;
}

.plugin-error-box strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: var(--cc-admin-type-body);
}

.plugin-actions {
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
}

.plugin-actions .button {
    min-height: 3.6rem;
    white-space: nowrap;
}

.empty-state-box {
    padding: 4rem 2rem;
    background: var(--admin-surface);
    border: 1px dashed var(--admin-border-strong);
    border-radius: var(--admin-radius-md);
}

.empty-icon-giant {
    margin-bottom: 1rem;
    font-size: 3.5rem;
}

@media (max-width: 900px) {
    .plugin-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .plugin-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .plugin-main-content {
        flex-direction: column;
    }

    .plugin-actions,
    .plugin-actions form,
    .plugin-actions .button {
        width: 100%;
    }
}

/* ========================================================================== 
   ADMIN MOBILE WIDTH CONTRACT
   Prevents complex authorization forms from expanding the page viewport.
   ========================================================================== */

#roleForm,
#userForm,
#roleForm .css-grid,
#userForm .css-grid,
#roleForm .css-grid > *,
#userForm .css-grid > *,
#roleForm .card,
#userForm .card {
    min-width: 0;
    max-width: 100%;
}

.matrix-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.matrix-container .capability-matrix {
    min-width: 62rem;
    margin-bottom: 0;
}

.permission-module-name,
.permission-module-id,
.readonly-role,
.protected-info,
.action-capability-item,
.action-capability-readonly,
.action-capability-item code,
.action-capability-readonly code {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 640px) {
    #roleForm .gap-large,
    #userForm .gap-large {
        gap: 1.5rem;
    }

    #roleForm .form-footer-dark,
    #userForm .form-footer-dark {
        width: 100%;
        max-width: 100%;
    }

    #roleForm .action-capability-list,
    #userForm .action-capability-list,
    #roleForm .super-admin-header,
    #userForm .super-admin-header,
    #roleForm .protected-role,
    #userForm .protected-role {
        min-width: 0;
        max-width: 100%;
    }

    #roleForm .protected-role,
    #userForm .protected-role {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 1rem;
    }
}

/* ========================================================================== 
   PLUGIN / MODULE MANAGEMENT UNIFICATION v3
   Structural alignment with standard admin sections and settings cards.
   ========================================================================== */

.cc-plugin-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cc-plugin-section {
    padding: 1.55rem;
}

.cc-plugin-section-head {
    margin-bottom: 1.2rem;
}

.cc-plugin-heading-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}


.cc-plugin-title {
    min-width: 0;
    margin: 0;
    color: var(--admin-text-strong);
    font-size: var(--cc-admin-type-section-title);
    font-weight: 780;
    line-height: 1.3;
    letter-spacing: -0.015em;
}

.cc-plugin-title a {
    color: inherit;
    text-decoration: none;
}

.cc-plugin-title a:hover {
    color: var(--admin-interactive-text);
}

.cc-plugin-description {
    max-width: 70rem;
    margin: 0.35rem 0 0;
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-help);
    line-height: 1.55;
}

.cc-plugin-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    overflow: hidden;
}

.cc-plugin-meta-grid > div {
    min-width: 0;
    padding: 1rem 1.1rem;
    background: var(--admin-bg-subtle);
    border-right: 1px solid var(--admin-border);
}

.cc-plugin-meta-grid > div:last-child {
    border-right: 0;
}

.cc-plugin-meta-grid dt {
    margin: 0 0 0.25rem;
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-meta);
    font-weight: 700;
    line-height: 1.35;
}

.cc-plugin-meta-grid dd {
    min-width: 0;
    margin: 0;
    color: var(--admin-text-strong);
    font-size: var(--cc-admin-type-body);
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.cc-plugin-error-box {
    margin-top: 1rem;
}

.cc-plugin-section-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--admin-border);
}

.cc-plugin-section-state {
    min-width: 0;
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-help);
}

.cc-plugin-actions {
    flex: 0 0 auto;
}

.cc-plugin-empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.cc-plugin-empty-state p {
    margin: 0.8rem 0 0;
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-body);
}

@media (max-width: 900px) {
    .cc-plugin-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cc-plugin-meta-grid > div:nth-child(2) {
        border-right: 0;
    }

    .cc-plugin-meta-grid > div:nth-child(-n + 2) {
        border-bottom: 1px solid var(--admin-border);
    }
}

@media (max-width: 640px) {
    .cc-plugin-section {
        padding: 1.25rem;
    }

    .cc-plugin-section-head,
    .cc-plugin-section-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .cc-plugin-section-head > .status-pill {
        align-self: flex-start;
    }

    .cc-plugin-meta-grid {
        grid-template-columns: 1fr;
    }

    .cc-plugin-meta-grid > div,
    .cc-plugin-meta-grid > div:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid var(--admin-border);
    }

    .cc-plugin-meta-grid > div:last-child {
        border-bottom: 0;
    }

    .cc-plugin-actions,
    .cc-plugin-actions form,
    .cc-plugin-actions .button {
        width: 100%;
    }
}

/* ========================================================================== 
   ADMIN TYPOGRAPHY CONTRACT v2
   Global readability floor for authenticated administration screens.
   ========================================================================== */

:root {
    --cc-admin-type-page-subtitle: 1.5rem;
    --cc-admin-type-section-title: 1.7rem;
    --cc-admin-type-card-title: 1.5rem;
    --cc-admin-type-body: 1.4rem;
    --cc-admin-type-help: 1.3rem;
    --cc-admin-type-meta: 1.2rem;
}

body.admin-shell .layout-content {
    font-size: var(--cc-admin-type-body);
}

body.admin-shell .layout-content :is(p, li, dd) {
    font-size: var(--cc-admin-type-body);
    line-height: 1.6;
}

body.admin-shell .layout-content :is(
    .header-title p,
    .page-header p,
    .dashboard-header p,
    .settings-header p,
    .cc-admin-page-header p
) {
    font-size: var(--cc-admin-type-page-subtitle);
}

body.admin-shell .layout-content :is(
    .cc-admin-section-header h2,
    .cc-admin-section-header h3,
    .cc-logs-section-head h2,
    .cc-settings-section-head h2,
    .cc-dashboard-section-head h2,
    .cc-security-section-head h2,
    .cc-users-section-head h2
) {
    font-size: var(--cc-admin-type-section-title);
}

body.admin-shell .layout-content :is(
    .cc-admin-section-header p,
    .cc-logs-section-head p,
    .cc-settings-section-head p,
    .cc-dashboard-section-head p,
    .cc-security-section-head p,
    .cc-users-section-head p,
    .help-text,
    .cc-admin-notice p,
    .cc-health-check-detail,
    .cc-dashboard-maintenance > p,
    .cc-dashboard-widget-content,
    .cc-dashboard-admin-action-copy p,
    .cc-logs-delete-hint,
    .cc-logs-empty p,
    .cc-settings-info p,
    .cc-settings-note p,
    .cc-settings-empty,
    .cc-smtp-test-result
) {
    font-size: var(--cc-admin-type-help);
    line-height: 1.6;
}

body.admin-shell .layout-content :is(
    .form-group label,
    label,
    .cc-logs-filter-grid label,
    .cc-users-filter-grid label,
    .cc-security-filter-grid label,
    .cc-security-block-form-grid label
) {
    font-size: var(--cc-admin-type-body);
}

body.admin-shell .layout-content :is(
    input[type="email"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="text"],
    input[type="url"],
    select,
    textarea
) {
    font-size: var(--cc-admin-type-body);
}

body.admin-shell .layout-content :is(
    .button,
    button.button,
    input[type="button"],
    input[type="reset"],
    input[type="submit"]
) {
    font-size: 1.3rem;
}

body.admin-shell .layout-content :is(table td, .card-table td) {
    font-size: var(--cc-admin-type-body);
}

body.admin-shell .layout-content :is(table th, .card-table th) {
    font-size: 1.15rem;
}

body.admin-shell .layout-content :is(
    .card-label,
    .cc-dashboard-system-list dt,
    .cc-logs-file-meta dt,
    .cc-log-time,
    .cc-log-request,
    .cc-logs-pagination strong,
    .cc-users-pagination strong,
    .cc-health-summary-stats dt,
    .cc-security-detail-list dt,
    .cc-security-index-list article > span
) {
    font-size: var(--cc-admin-type-meta);
}

body.admin-shell .layout-content :is(
    .cc-dashboard-kpi-label,
    .cc-dashboard-kpi-meta,
    .cc-dashboard-card-link,
    .cc-dashboard-quick-action small,
    .cc-dashboard-page-slug,
    .cc-dashboard-page-time,
    .cc-dashboard-notice-copy p,
    .cc-dashboard-all-good p,
    .cc-dashboard-empty p,
    .cc-dashboard-system-list dd,
    .cc-security-metric span,
    .cc-security-client-ip span,
    .cc-security-client-ip small,
    .cc-security-block-submit small,
    .cc-log-context summary,
    .cc-log-context pre
) {
    font-size: var(--cc-admin-type-help);
}

body.admin-shell .layout-content :is(
    .cc-dashboard-quick-action strong,
    .cc-dashboard-page-title,
    .cc-dashboard-notice-copy strong,
    .cc-dashboard-all-good strong,
    .cc-dashboard-empty strong,
    .cc-admin-notice strong,
    .cc-security-metric strong,
    .cc-security-client-ip strong,
    .cc-security-detail-list dd,
    .cc-log-message,
    .cc-settings-info strong,
    .cc-settings-note strong
) {
    font-size: var(--cc-admin-type-body);
}

body.admin-shell .layout-content :is(
    .cc-dashboard-widget h3,
    .cc-dashboard-admin-action-copy h3,
    .cc-honeypot-panel h3,
    .cc-admin-card-title
) {
    font-size: var(--cc-admin-type-card-title);
}

body.admin-shell .layout-content :is(
    .cc-path-chip,
    .cc-honeypot-row code,
    .cc-settings-inline-message,
    .record-count,
    .error-text
) {
    font-size: var(--cc-admin-type-meta);
}

body.admin-shell .layout-content :is(
    .badge,
    .status-pill,
    .badge-outline,
    .log-badge,
    .cc-secret-status,
    .cc-health-status-badge
) {
    font-size: 1.1rem;
}

/* Capability identifiers are technical metadata and may remain compact. */
body.admin-shell .layout-content .capability-cell-label {
    font-size: 1rem;
    line-height: 1.4;
}

@media (max-width: 640px) {
    body.admin-shell .layout-content {
        font-size: var(--cc-admin-type-body);
    }
}

/* ==========================================================================
   Admin shell – 10.5-D Header / Navigation / Responsive
   ========================================================================== */

/*
 * Der linke Headerbereich darf den Accountbereich nicht aus dem Viewport
 * drücken. Breadcrumbs kürzen bei langen Seitennamen kontrolliert ein.
 */
.layout-header-left {
    flex: 1 1 auto;
    overflow: hidden;
}

.breadcrumbs {
    overflow: hidden;
    white-space: nowrap;
}

.breadcrumbs a,
.breadcrumbs strong {
    min-width: 0;
}

/*
 * Desktop-Accountbereich: Benutzerangaben und Abmelden gehören sichtbar
 * zusammen. Lange Namen werden gekürzt, ohne den Header zu verbreitern.
 */
.user-profile {
    flex: 0 1 auto;
    min-width: 0;
    margin-left: 2rem;
    gap: 1.2rem;
}

.user-info {
    min-width: 0;
    max-width: 18rem;
}

.user-name,
.user-role {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-logout-form {
    flex: 0 0 auto;
    margin: 0 0 0 0.6rem;
    padding: 0 0 0 1.6rem;
    border-left: 1px solid var(--admin-border);
}

.header-logout-form .header-logout {
    min-height: 3.8rem;
    margin: 0;
    padding-inline: 1.5rem;
    white-space: nowrap;
}

/*
 * Auf Desktop befindet sich Abmelden im Header. Im Mobile-Drawer bleibt die
 * vorhandene Footer-Aktion erhalten, damit der kompakte Header frei bleibt.
 */
@media (min-width: 1025px) {
    .sidebar-logout-form {
        display: none;
    }

    .sidebar-user-card {
        margin-bottom: 0;
    }
}

/*
 * Der Navigationsbereich scrollt unabhängig vom Footer und hält auch bei
 * langen Menüs die Kontoaktion erreichbar.
 */
.sidebar-nav {
    min-height: 0;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

@media (max-width: 1024px) {
    .layout-sidebar {
        height: 100dvh;
        max-height: 100dvh;
    }

    .layout-header-left {
        overflow: hidden;
    }

    /* Auf kleinen Breiten genügt der aktuelle Breadcrumb-Eintrag. */
    .breadcrumbs > a,
    .breadcrumbs > .breadcrumb-separator {
        display: none;
    }

    .breadcrumbs {
        max-width: none;
    }

    .user-profile {
        flex: 0 0 auto;
        margin-left: 1.2rem;
    }

    .header-logout-form {
        display: none;
    }

    .sidebar-user-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 640px) {
    .layout-header {
        gap: 1rem;
        padding-inline: 1.2rem;
    }

    .layout-header-left {
        gap: 0.8rem;
    }

    .breadcrumbs {
        flex: 1 1 auto;
        max-width: none;
    }

    .breadcrumbs strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-profile {
        margin-left: 0;
    }
}

/* --------------------------------------------------------------------------
   Plugin upgrade: isolated per-plugin package workflow
   -------------------------------------------------------------------------- */

.cc-plugin-upgrade-details {
    position: relative;
    margin: 0;
}

.cc-plugin-upgrade-details[open] {
    flex: 1 1 27rem;
    min-width: 0;
    max-width: min(32rem, 100%);
}

.cc-plugin-upgrade-details > summary {
    list-style: none;
    cursor: pointer;
}

.cc-plugin-upgrade-details > summary::-webkit-details-marker {
    display: none;
}

.cc-plugin-upgrade-form {
    position: static;
    display: grid;
    width: 100%;
    gap: 0.75rem;
    margin-top: 0.55rem;
    padding: 0.9rem;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--shadow-md);
}

.cc-plugin-upgrade-form label {
    display: block;
    min-width: 0;
}

.cc-plugin-upgrade-form input[type="file"] {
    display: block;
    width: 100%;
    min-width: 0;
}

@media (max-width: 640px) {
    .cc-plugin-upgrade-details,
    .cc-plugin-upgrade-details > summary,
    .cc-plugin-upgrade-form {
        width: 100%;
    }

    .cc-plugin-upgrade-form {
        position: static;
        margin-top: 0.75rem;
    }
}

/* ==========================================================================
   ADMIN-R1.3b-1 – Visual Completion / Shell Refinement
   Consolidated current layer for Sidebar, Topbar and Page Header. The
   ADMIN-R1.3 auth lockup remains frozen below until R1.3b-5.
   ========================================================================== */

/* The supplied CodiCraft bear is the compact runtime product mark in the
 * dark admin sidebar. The wider UI keeps the warm Codi Bear colour mood. */
body.admin-shell {
    background: var(--admin-bg);
}

.layout-main {
    background:
        radial-gradient(
            circle at 88% 4%,
            color-mix(in srgb, var(--admin-primary) 5%, transparent),
            transparent 28rem
        ),
        var(--admin-bg);
}

/* --------------------------------------------------------------------------
   Sidebar – stronger independent shell surface
   -------------------------------------------------------------------------- */
.layout-sidebar {
    background:
        radial-gradient(
            circle at 16% -4%,
            color-mix(in srgb, var(--admin-primary) 16%, transparent),
            transparent 19rem
        ),
        linear-gradient(180deg, #252a2d 0%, var(--admin-surface-dark) 46%, #1b1f21 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.055);
    box-shadow: 10px 0 30px rgba(21, 23, 25, 0.08);
}

.sidebar-brand {
    min-height: var(--header-height);
    padding: 1.25rem 1.25rem 1.2rem 1.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.085);
}

.sidebar-brand-link {
    gap: 1rem;
}

.auth-brand-symbol {
    display: grid;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(145deg, #eb852f 0%, var(--admin-primary) 55%, #bf5b10 100%);
    border: 1px solid color-mix(in srgb, var(--admin-primary) 72%, #ffffff);
    box-shadow:
        0 8px 20px rgba(223, 117, 29, 0.22),
        inset 0 1px rgba(255, 255, 255, 0.2);
    font-weight: 800;
    letter-spacing: -0.055em;
}

.sidebar-brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 4.6rem;
    width: 4.6rem;
    height: 4.6rem;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.sidebar-brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cc-brand-wordmark,
.auth-brand-wordmark {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.cc-brand-wordmark span,
.auth-brand-wordmark span {
    color: color-mix(in srgb, var(--admin-primary) 68%, #ffffff);
}

.sidebar-brand-copy small {
    color: #9fa7aa;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.sidebar-collapse-button,
.sidebar-close-button {
    color: #c7cdcf;
    background: rgba(255, 255, 255, 0.025);
    border-color: rgba(255, 255, 255, 0.11);
}

.sidebar-collapse-button:hover,
.sidebar-close-button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.075);
    border-color: rgba(255, 255, 255, 0.18);
}

[data-admin-sidebar-collapse-icon] {
    display: grid;
    place-items: center;
    transition: transform var(--admin-motion-standard) var(--admin-motion-ease);
    transform: rotate(180deg);
}

body.sidebar-collapsed [data-admin-sidebar-collapse-icon] {
    transform: rotate(0deg);
}

.sidebar-close-button {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-close-button .cc-icon,
.mobile-menu-button .cc-icon {
    width: 2.1rem;
    height: 2.1rem;
}

.sidebar-nav {
    padding: 1.35rem 1rem 1.6rem;
}

.nav-link {
    position: relative;
    min-height: 4.7rem;
    gap: 0.95rem;
    margin: 0.28rem 0;
    padding: 0.8rem 0.9rem;
    color: #bac1c3;
    border: 1px solid transparent;
    border-radius: 0.95rem;
    font-weight: 600;
    transition:
        color var(--admin-motion-fast) var(--admin-motion-ease),
        background-color var(--admin-motion-fast) var(--admin-motion-ease),
        border-color var(--admin-motion-fast) var(--admin-motion-ease),
        box-shadow var(--admin-motion-fast) var(--admin-motion-ease);
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(255, 255, 255, 0.07);
}

.nav-link-active {
    color: #ffffff;
    background: linear-gradient(135deg, #b95a12 0%, var(--admin-action-bg) 58%, #8f3f0b 100%);
    border-color: color-mix(in srgb, var(--admin-primary) 72%, #ffffff);
    box-shadow:
        0 8px 22px rgba(223, 117, 29, 0.22),
        inset 0 1px rgba(255, 255, 255, 0.15);
    transform: none;
}

.nav-link-icon {
    flex-basis: 3rem;
    width: 3rem;
    height: 3rem;
    color: #aeb6b8;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0.8rem;
    font-size: 1.35rem;
}

.nav-link:hover .nav-link-icon {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
}

.nav-link-active .nav-link-icon {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.18);
}

.nav-link-icon .cc-icon {
    width: 2rem;
    height: 2rem;
}

.nav-link-extension-icon {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    line-height: 1;
}

.sidebar-footer {
    padding: 1.1rem;
    border-top-color: rgba(255, 255, 255, 0.075);
}

.sidebar-user-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
}

.sidebar-user-avatar,
.user-avatar {
    color: #ffffff;
    background: var(--admin-surface-dark-soft);
    border: 1px solid color-mix(in srgb, var(--admin-primary) 38%, transparent);
    box-shadow: none;
}

.sidebar-logout,
.header-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

/* Collapsed desktop navigation keeps the selected destination obvious. */
body.sidebar-collapsed .nav-link-active {
    box-shadow:
        0 7px 18px rgba(223, 117, 29, 0.22),
        inset 0 1px rgba(255, 255, 255, 0.14);
}

/* --------------------------------------------------------------------------
   Topbar – integrated utility row, not another card
   -------------------------------------------------------------------------- */
.layout-header {
    min-height: 6.2rem;
    height: auto;
    top: 0;
    gap: 1.4rem;
    margin: 0;
    padding: 0 2.4rem;
    background: transparent;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--admin-border) 72%, transparent);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.layout-header-left {
    gap: 1rem;
}

.mobile-menu-button {
    display: none;
    place-items: center;
    padding: 0;
    color: var(--admin-text-strong);
    background: var(--admin-surface);
    border-color: var(--admin-border);
    box-shadow: var(--admin-elevation-1);
}

.mobile-menu-button span {
    display: none;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    min-width: 0;
    font-size: 1.12rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.breadcrumbs a {
    color: var(--admin-text-soft);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--admin-primary-hover);
}

.breadcrumbs strong {
    color: var(--admin-text-strong);
    font-weight: 700;
}

.breadcrumb-separator,
.breadcrumbs > span {
    color: color-mix(in srgb, var(--admin-text-muted) 48%, transparent);
}

.user-profile {
    gap: 0.8rem;
}

.user-info {
    max-width: 16rem;
}

.user-name {
    color: var(--admin-text-strong);
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: none;
}

.user-role {
    color: var(--admin-text-muted);
    font-size: 0.95rem;
    text-transform: none;
}

.user-avatar {
    width: 3.8rem;
    height: 3.8rem;
    border-radius: 0.95rem;
    background: linear-gradient(145deg, #2f3538, var(--admin-surface-dark));
    box-shadow: var(--admin-elevation-1);
}

.header-logout-form {
    padding-left: 1rem;
    border-left-color: color-mix(in srgb, var(--admin-border) 72%, transparent);
}

.header-logout-form .header-logout {
    min-height: 3.7rem;
    color: var(--admin-text);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.header-logout-form .header-logout:hover {
    color: var(--admin-primary-hover);
    background: var(--admin-primary-soft);
    border-color: var(--admin-primary-border);
    box-shadow: none;
}

/* --------------------------------------------------------------------------
   Work area and page headings
   -------------------------------------------------------------------------- */
.layout-content {
    padding: 2.8rem 2.4rem 4rem;
}

.layout-footer {
    flex: 0 0 auto;
    padding: 1.5rem 2.4rem 1.8rem;
    color: var(--admin-text-muted);
    border-top: 1px solid color-mix(in srgb, var(--admin-border) 72%, transparent);
}

.layout-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    flex-wrap: wrap;
    font-size: 1rem;
    line-height: 1.5;
}

.layout-footer a {
    color: var(--admin-text-soft);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--admin-motion-fast) var(--admin-motion-ease);
}

.layout-footer a:hover {
    color: var(--admin-primary-hover);
}

.layout-footer a:focus-visible {
    outline: 2px solid var(--admin-focus-ring);
    outline-offset: 3px;
    border-radius: 0.25rem;
}

@media (max-width: 640px) {
    .layout-footer {
        padding: 1.35rem 1.4rem 1.6rem;
    }

    .layout-footer-inner {
        justify-content: center;
        text-align: center;
    }
}

/* The page title is context, not another card. Feature cards now own the
 * visual weight below it. This class contract is shared by theme and module
 * fallback views. */
.cc-admin-page-header,
.page-header,
.dashboard-header,
.settings-header {
    padding: 0.55rem 0.2rem 1.9rem;
    background: transparent;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--admin-border) 80%, transparent);
    border-radius: 0;
    box-shadow: none;
}

.cc-admin-page-header {
    align-items: flex-end;
    margin-bottom: 2.5rem;
}

.cc-admin-page-heading {
    max-width: 76rem;
}

.cc-admin-page-kicker {
    margin-bottom: 0.35rem;
    color: var(--admin-primary-hover);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.11em;
}

.cc-admin-page-header h1,
.page-header h1,
.dashboard-header h1,
.settings-header h1 {
    margin-bottom: 0.55rem;
    color: var(--admin-text-strong);
    font-weight: 700;
    letter-spacing: -0.04em;
}

.cc-admin-page-header p,
.page-header p,
.dashboard-header p,
.settings-header p {
    color: var(--admin-text-muted);
}

.cc-admin-page-actions {
    align-self: center;
    gap: 0.8rem;
}

.cc-admin-page-actions > .button,
.cc-admin-page-actions > a.button,
.cc-admin-page-actions > form > .button {
    box-shadow: var(--admin-elevation-1);
}

/* --------------------------------------------------------------------------
   ADMIN-R1.3 frozen auth product lockup
   -------------------------------------------------------------------------- */
.auth-body {
    background: var(--admin-bg);
}

.auth-wrapper {
    max-width: 82rem;
    margin-inline: auto;
}

.auth-brand-lockup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin: 0 auto 1.5rem;
    color: var(--admin-text-strong);
}

.auth-brand-symbol {
    display: grid;
    place-items: center;
    width: 4.8rem;
    height: 4.8rem;
    overflow: hidden;
    background: var(--admin-surface-dark);
    border-radius: 1rem;
    box-shadow: var(--admin-elevation-2);
}

.auth-brand-logo,
.auth-brand-mark img {
    display: block;
    width: 3.7rem;
    height: 3.7rem;
    object-fit: contain;
}

.auth-header .auth-brand-mark {
    display: grid;
    place-items: center;
    width: 4.8rem;
    height: 4.8rem;
    margin: 0 auto 1rem;
    overflow: hidden;
    background: var(--admin-surface-dark);
    border: 0;
    border-radius: 1rem;
    box-shadow: var(--admin-elevation-2);
}

.auth-brand-wordmark {
    color: var(--admin-text-strong);
    font-size: 1.85rem;
}

.auth-brand-wordmark span {
    color: var(--admin-primary-hover);
}

.auth-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    box-shadow: var(--admin-elevation-2);
}

.auth-accent-line {
    height: 0.3rem;
}

.auth-header {
    margin-bottom: 2.5rem;
}

.auth-kicker {
    color: var(--admin-primary-hover);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.09em;
}

.auth-title {
    color: var(--admin-text-strong);
    font-weight: 700;
    letter-spacing: -0.04em;
}

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

@media (max-width: 1024px) {
    .layout-header {
        top: 0.75rem;
        margin: 0.9rem 1.4rem 0;
    }

    .layout-content {
        padding: 2.4rem 1.4rem 3.5rem;
    }

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

    .sidebar-brand {
        padding: 1.1rem 1.3rem;
    }
}

@media (max-width: 640px) {
    .layout-header {
        top: 0;
        min-height: var(--header-height);
        margin: 0;
        padding: 0.85rem 1.2rem;
        border-width: 0 0 1px;
        border-radius: 0;
        box-shadow: var(--admin-elevation-1);
        backdrop-filter: blur(12px);
    }

    .layout-content {
        padding: 2rem 1.2rem 3rem;
    }

    .cc-admin-page-header,
    .page-header,
    .dashboard-header,
    .settings-header {
        gap: 1.3rem;
        padding: 0.25rem 0 1.5rem;
    }

    .cc-admin-page-header {
        align-items: flex-start;
    }

    .cc-admin-page-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .auth-brand-lockup {
        margin-bottom: 1.2rem;
    }

    .auth-brand-symbol {
        width: 3.8rem;
        height: 3.8rem;
        font-size: 1.55rem;
    }

    .auth-brand-wordmark {
        font-size: 1.7rem;
    }
}


/* ==========================================================================
   ADMIN-R1.3b VISUAL REWORK 1 – calm interaction policy
   Visual feedback may change colour/elevation, but card-like surfaces never
   move or scale on pointer hover.
   ========================================================================== */
.card:hover,
.tool-card:hover,
.perf-card:hover,
.plugin-active:hover,
.plugin-inactive:hover,
.empty-state-box:hover,
.cc-dashboard-kpi:hover,
.cc-dashboard-quick-action:hover,
.cc-dashboard-panel:hover,
.cc-dashboard-section:hover {
    transform: none !important;
}

/* ==========================================================================
   ADMIN-R1.3b VISUAL REWORK 2 – color harmonization
   Ordinary actions use CodiCraft orange or neutral graphite surfaces. Blue is
   reserved for real informational state. Panels share one graphite/brand
   hierarchy and sticky form actions use a light compact dock.
   ========================================================================== */

:root {
    --cc-action-secondary-bg: var(--admin-surface-raised);
    --cc-action-secondary-text: var(--admin-text-strong);
    --cc-action-secondary-border: var(--admin-border-strong);
    --cc-action-secondary-hover-bg: var(--admin-primary-soft);
    --cc-action-secondary-hover-text: var(--admin-primary-hover);
    --cc-panel-header-bg: var(--admin-surface-dark);
    --cc-panel-header-text: #ffffff;
    --cc-panel-header-muted: #d8d2c9;
    --cc-action-dock-bg: rgba(255, 255, 255, 0.96);
}

/* Milligram uses a more specific .button.button-outline selector. Mirror that
 * specificity here so legacy blue can no longer leak into normal actions. */
.button.button-outline,
a.button.button-outline,
button.button-outline,
input[type="button"].button-outline,
input[type="reset"].button-outline,
input[type="submit"].button-outline {
    color: var(--cc-action-secondary-text);
    background: var(--cc-action-secondary-bg);
    border-color: var(--cc-action-secondary-border);
}

.button.button-outline:hover,
.button.button-outline:focus,
a.button.button-outline:hover,
a.button.button-outline:focus,
button.button-outline:hover,
button.button-outline:focus,
input[type="button"].button-outline:hover,
input[type="button"].button-outline:focus,
input[type="reset"].button-outline:hover,
input[type="reset"].button-outline:focus,
input[type="submit"].button-outline:hover,
input[type="submit"].button-outline:focus {
    color: var(--cc-action-secondary-hover-text);
    background: var(--cc-action-secondary-hover-bg);
    border-color: var(--admin-primary-border);
    box-shadow: var(--admin-elevation-1);
    transform: none;
}

.button.button-clear,
a.button.button-clear,
button.button-clear,
input[type="button"].button-clear,
input[type="reset"].button-clear,
input[type="submit"].button-clear {
    color: var(--admin-text-muted);
    background: transparent;
    border-color: transparent;
}

.button.button-clear:hover,
.button.button-clear:focus,
a.button.button-clear:hover,
a.button.button-clear:focus,
button.button-clear:hover,
button.button-clear:focus,
input[type="button"].button-clear:hover,
input[type="button"].button-clear:focus,
input[type="reset"].button-clear:hover,
input[type="reset"].button-clear:focus,
input[type="submit"].button-clear:hover,
input[type="submit"].button-clear:focus {
    color: var(--admin-primary-hover);
    background: var(--admin-primary-soft);
    border-color: transparent;
    transform: none;
}

.button.button-clear.button-delete,
button.button-clear.button-delete {
    color: var(--admin-text-muted);
}

.button.button-clear.button-delete:hover,
.button.button-clear.button-delete:focus,
button.button-clear.button-delete:hover,
button.button-clear.button-delete:focus {
    color: var(--admin-danger);
    background: var(--admin-danger-soft);
}

/* Buttons stay spatially stable; feedback is color/elevation only. */
.button:hover,
button.button:hover,
.button-large:hover,
.button-primary:hover,
.button-black:hover,
.button-accent:hover,
.button-error:hover,
.button-danger:hover {
    transform: none;
}

/* Page-header actions are secondary utility actions unless explicitly marked
 * primary in the view. */
body.admin-shell .cc-admin-page-actions .button.button-outline,
body.admin-shell .header-actions .button.button-outline,
body.admin-shell .header-actions-group .button.button-outline {
    color: var(--cc-action-secondary-text);
    background: var(--cc-action-secondary-bg);
    border-color: var(--cc-action-secondary-border);
}

body.admin-shell .cc-admin-page-actions .button.button-outline:hover,
body.admin-shell .header-actions .button.button-outline:hover,
body.admin-shell .header-actions-group .button.button-outline:hover {
    color: var(--admin-primary-hover);
    background: var(--admin-primary-soft);
    border-color: var(--admin-primary-border);
}

/* Shared material headers use one graphite surface with a single orange edge.
 * Large orange header slabs are intentionally removed to calm the palette. */
body.admin-shell .cc-dashboard-section-head,
body.admin-shell .cc-dashboard-panel.is-recent-pages .cc-dashboard-section-head,
body.admin-shell .cc-settings-section-head {
    color: var(--cc-panel-header-text);
    background: var(--cc-panel-header-bg);
    border-bottom: 0.3rem solid var(--admin-primary);
}

body.admin-shell .cc-dashboard-section-head h2,
body.admin-shell .cc-settings-section-head h2 {
    color: var(--cc-panel-header-text);
}

body.admin-shell .cc-dashboard-section-head p,
body.admin-shell .cc-settings-section-head p {
    color: var(--cc-panel-header-muted);
    opacity: 1;
}

body.admin-shell .cc-dashboard-section-head .button.button-outline {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

body.admin-shell .cc-dashboard-section-head .button.button-outline:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.46);
}

/* Non-semantic chips and log navigation must not reintroduce blue. */
body.admin-shell .cc-settings-section .cc-path-chip {
    color: var(--admin-brand-strong);
    background: var(--admin-primary-soft);
    border-color: var(--admin-primary-border);
}

body.admin-shell .channel-active .channel-label,
body.admin-shell .file-active {
    color: var(--admin-interactive-text);
}

body.admin-shell .log-context pre,
body.admin-shell .cc-log-context pre {
    color: var(--admin-text-inverse);
}

/* Compact light action dock replaces the former full-width dark save bar. */
body.admin-shell .sticky-footer {
    position: sticky;
    bottom: 1.25rem;
    z-index: 40;
    margin: 2rem 0 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    pointer-events: none;
}

body.admin-shell .sticky-footer-inner {
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    padding: 0.75rem;
    background: var(--cc-action-dock-bg);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--admin-elevation-3);
    backdrop-filter: blur(18px) saturate(135%);
    pointer-events: auto;
}

body.admin-shell .cc-settings-save-footer {
    justify-content: flex-end;
    gap: 0.75rem;
}

body.admin-shell .cc-settings-save-footer .button-large {
    min-height: 4.2rem;
    height: auto;
    margin: 0;
    padding: 0.9rem 1.45rem;
    border-radius: 0.9rem;
    font-size: 1.25rem;
    font-weight: 760;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
}

/* Static form footers follow the same neutral surface hierarchy. */
body.admin-shell .form-footer-dark {
    color: var(--admin-text);
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--admin-elevation-2);
}

body.admin-shell .form-footer-dark .btn-link-muted {
    color: var(--admin-text-muted);
}

body.admin-shell .form-footer-dark .btn-link-muted:hover {
    color: var(--admin-primary-hover);
}

@media (max-width: 40rem) {
    body.admin-shell .sticky-footer {
        position: fixed;
        right: 1rem;
        bottom: 1rem;
        left: 1rem;
        margin: 0;
        padding: 0;
        background: transparent;
        border: 0;
    }

    body.admin-shell .sticky-footer-inner {
        width: 100%;
        margin: 0;
        padding: 0.7rem;
        background: var(--cc-action-dock-bg);
        border: 1px solid var(--admin-border);
        box-shadow: var(--admin-elevation-4);
    }

    body.admin-shell .sticky-footer .button {
        width: 100%;
    }
}

/* ==========================================================================
   ADMIN-R1.3b VISUAL REWORK 2 – Gate Fix 1 / opaque sticky utility bar
   The sticky account/breadcrumb bar must remain fully readable while content
   scrolls underneath it. No transparency or backdrop sampling is permitted.
   ========================================================================== */
body.admin-shell .layout-header {
    background: var(--admin-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* ==========================================================================
   ADMIN-R1.3b-3 / part 1 – Navigation icon picker
   Manual admin navigation uses canonical local SVG icon keys. The picker is a
   stable surface: hover/focus may change color/elevation, never position.
   ========================================================================== */
body.admin-shell .nav-item-row {
    gap: 1.25rem;
    padding: 1.25rem;
    background: var(--admin-surface);
    border-color: var(--admin-border);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--admin-elevation-1);
}

body.admin-shell .nav-item-row:hover {
    border-color: var(--admin-border-strong);
    box-shadow: var(--admin-elevation-2);
    transform: none;
}

body.admin-shell .nav-item-new {
    background: var(--admin-primary-soft);
    border-color: var(--admin-primary-border);
    border-style: dashed;
}

body.admin-shell .nav-icon-picker,
body.admin-shell .nav-icon-static {
    position: relative;
    flex: 0 0 18rem;
    min-width: 0;
}

body.admin-shell .nav-icon-trigger,
body.admin-shell .nav-icon-static {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    width: 100%;
    min-height: 5.4rem;
    height: auto;
    margin: 0;
    padding: 0.65rem 0.8rem;
    color: var(--admin-text);
    background: var(--admin-surface-muted);
    border: 1px solid var(--admin-border);
    border-radius: 1rem;
    box-shadow: none;
    font-size: 1.2rem;
    line-height: 1.25;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    transform: none;
}

body.admin-shell .nav-icon-trigger:hover,
body.admin-shell .nav-icon-trigger:focus,
body.admin-shell .nav-icon-trigger[aria-expanded="true"] {
    color: var(--admin-text-strong);
    background: var(--admin-primary-soft);
    border-color: var(--admin-primary-border);
    box-shadow: var(--admin-elevation-1);
    transform: none;
}

body.admin-shell .nav-icon-trigger:focus-visible,
body.admin-shell .nav-icon-option:focus-visible {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: var(--admin-focus-ring);
}

body.admin-shell .nav-icon-trigger-visual,
body.admin-shell .nav-icon-static-visual,
body.admin-shell .nav-icon-option-visual {
    display: inline-grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    color: var(--admin-primary);
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 0.85rem;
}

body.admin-shell .nav-icon-trigger-visual .cc-icon,
body.admin-shell .nav-icon-static-visual .cc-icon,
body.admin-shell .nav-icon-option-visual .cc-icon {
    width: 2rem;
    height: 2rem;
}

body.admin-shell .nav-icon-trigger-copy,
body.admin-shell .nav-icon-static-copy,
body.admin-shell .nav-icon-option-copy {
    display: grid;
    min-width: 0;
    gap: 0.15rem;
}

body.admin-shell .nav-icon-trigger-copy strong,
body.admin-shell .nav-icon-static-copy strong,
body.admin-shell .nav-icon-option-copy strong {
    overflow: hidden;
    color: var(--admin-text-strong);
    font-size: 1.2rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.admin-shell .nav-icon-trigger-copy small,
body.admin-shell .nav-icon-static-copy small,
body.admin-shell .nav-icon-option-copy small {
    overflow: hidden;
    color: var(--admin-text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1rem;
    font-weight: 500;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
}

body.admin-shell .nav-icon-trigger-chevron {
    color: var(--admin-text-muted);
    transform: rotate(90deg);
    transition: transform var(--admin-motion-fast) ease;
}

body.admin-shell .nav-icon-trigger[aria-expanded="true"] .nav-icon-trigger-chevron {
    transform: rotate(-90deg);
}

body.admin-shell .nav-icon-menu {
    position: absolute;
    top: calc(100% + 0.55rem);
    left: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: min(38rem, calc(100vw - 4rem));
    max-height: 34rem;
    padding: 0.65rem;
    overflow: auto;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--admin-elevation-4);
}

body.admin-shell .nav-icon-menu[hidden] {
    display: none;
}

body.admin-shell .nav-icon-option {
    display: grid;
    grid-template-columns: 3.4rem minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
    min-width: 0;
    min-height: 4.7rem;
    height: auto;
    margin: 0;
    padding: 0.55rem;
    color: var(--admin-text);
    background: var(--admin-surface);
    border: 1px solid transparent;
    border-radius: 0.85rem;
    box-shadow: none;
    line-height: 1.2;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    transform: none;
}

body.admin-shell .nav-icon-option:hover,
body.admin-shell .nav-icon-option:focus {
    color: var(--admin-text-strong);
    background: var(--admin-surface-muted);
    border-color: var(--admin-border);
    transform: none;
}

body.admin-shell .nav-icon-option.is-selected,
body.admin-shell .nav-icon-option[aria-selected="true"] {
    color: var(--admin-primary-hover);
    background: var(--admin-primary-soft);
    border-color: var(--admin-primary-border);
}

body.admin-shell .nav-icon-option-visual {
    width: 3.4rem;
    height: 3.4rem;
}

body.admin-shell .nav-icon-none-mark {
    color: var(--admin-text-muted);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

body.admin-shell .nav-icon-extension-value {
    overflow: hidden;
    max-width: 3rem;
    font-size: 1.8rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.admin-shell .nav-icon-static {
    grid-template-columns: 4rem minmax(0, 1fr);
}

body.admin-shell .nav-link-no-icon {
    display: block;
    width: 1.8rem;
    height: 1.8rem;
}

@media (max-width: 74rem) {
    body.admin-shell .nav-item-row {
        flex-wrap: wrap;
    }

    body.admin-shell .nav-icon-picker,
    body.admin-shell .nav-icon-static {
        flex-basis: min(24rem, 100%);
    }

    body.admin-shell .nav-inputs {
        flex: 1 1 28rem;
    }
}

@media (max-width: 48rem) {
    body.admin-shell .nav-icon-picker,
    body.admin-shell .nav-icon-static,
    body.admin-shell .nav-inputs,
    body.admin-shell .nav-actions {
        flex: 1 1 100%;
        width: 100%;
    }

    body.admin-shell .nav-actions {
        justify-content: space-between;
    }

    body.admin-shell .nav-icon-menu {
        grid-template-columns: 1fr;
        width: 100%;
    }
}

/* ==========================================================================
   ADMIN-R1.3b-3 / part 1.1 – Expanded navigation icon catalog
   The picker groups the larger local sprite catalog and filters it locally.
   ========================================================================== */
body.admin-shell .nav-icon-menu {
    display: block;
    width: min(52rem, calc(100vw - 4rem));
    max-height: 40rem;
    padding: 0;
    overflow: auto;
}

body.admin-shell .nav-icon-menu[hidden] {
    display: none;
}

body.admin-shell .nav-icon-search {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
    margin: 0;
    padding: 0.8rem;
    background: var(--admin-surface);
    border-bottom: 1px solid var(--admin-border);
}

body.admin-shell .nav-icon-search .cc-icon {
    color: var(--admin-text-muted);
}

body.admin-shell .nav-icon-search input[type="search"] {
    height: 3.8rem;
    margin: 0;
    padding: 0 1rem;
    color: var(--admin-text);
    background: var(--admin-surface-muted);
    border: 1px solid var(--admin-border);
    border-radius: 0.8rem;
    box-shadow: none;
}

body.admin-shell .nav-icon-search input[type="search"]:focus {
    border-color: var(--admin-primary-border);
    box-shadow: var(--admin-focus-ring);
}

body.admin-shell .nav-icon-groups {
    display: grid;
    gap: 0.9rem;
    padding: 0.8rem;
}

body.admin-shell .nav-icon-group {
    display: grid;
    gap: 0.55rem;
}

body.admin-shell .nav-icon-group[hidden],
body.admin-shell .nav-icon-option[hidden],
body.admin-shell .nav-icon-no-results[hidden] {
    display: none;
}

body.admin-shell .nav-icon-group-title {
    margin: 0;
    padding: 0.15rem 0.2rem;
    color: var(--admin-text-muted);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
}

body.admin-shell .nav-icon-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

body.admin-shell .nav-icon-no-results {
    margin: 0;
    padding: 1.25rem;
    color: var(--admin-text-muted);
    text-align: center;
}

@media (max-width: 48rem) {
    body.admin-shell .nav-icon-menu {
        width: 100%;
    }

    body.admin-shell .nav-icon-group-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   ADMIN-R1.3b-4 – system-wide admin view unification
   Dashboard and System Settings are the visual reference for every browser-
   rendered admin surface. Major sections use one graphite header slab, one
   orange divider and a quiet elevated light body. Specialised workspaces keep
   their functional layout while inheriting the same palette and hierarchy.
   ========================================================================== */

body.admin-shell .cc-admin-panel,
body.admin-shell .cc-admin-filter-card,
body.admin-shell .cc-admin-surface-card,
body.admin-shell .cc-admin-form-card,
body.admin-shell .cc-admin-list-card,
body.admin-shell .cc-plugin-section,
body.admin-shell .cc-security-section,
body.admin-shell .cc-health-section {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--admin-elevation-2);
    transform: none;
}

body.admin-shell .cc-admin-panel,
body.admin-shell .cc-admin-filter-card,
body.admin-shell .cc-plugin-section,
body.admin-shell .cc-security-section,
body.admin-shell .cc-health-section {
    padding: 1.5rem;
    overflow: hidden;
}

body.admin-shell .cc-admin-panel--flush,
body.admin-shell .cc-admin-list-card {
    padding: 0;
    overflow: hidden;
}

body.admin-shell .cc-admin-panel:hover,
body.admin-shell .cc-admin-filter-card:hover,
body.admin-shell .cc-admin-surface-card:hover,
body.admin-shell .cc-admin-form-card:hover,
body.admin-shell .cc-admin-list-card:hover,
body.admin-shell .cc-plugin-section:hover,
body.admin-shell .cc-security-section:hover,
body.admin-shell .cc-health-section:hover {
    border-color: var(--admin-border);
    box-shadow: var(--admin-elevation-2);
    transform: none;
}

/* One section-heading contract across settings, content, operations and plugins. */
body.admin-shell .cc-admin-panel-head,
body.admin-shell .cc-settings-section-head,
body.admin-shell .cc-users-section-head,
body.admin-shell .cc-logs-section-head,
body.admin-shell .cc-admin-list-section-head,
body.admin-shell .cc-plugin-section > .cc-plugin-section-head,
body.admin-shell .cc-plugin-section > .cc-admin-section-header,
body.admin-shell .cc-security-section > .cc-security-section-head,
body.admin-shell .cc-health-section > .cc-admin-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: -1.5rem -1.5rem 1.35rem;
    padding: 1.2rem 1.5rem;
    color: var(--cc-panel-header-text);
    background: var(--cc-panel-header-bg);
    border: 0;
    border-bottom: 0.3rem solid var(--admin-primary);
}

body.admin-shell .cc-admin-panel--flush > .cc-admin-panel-head,
body.admin-shell .cc-admin-list-card > .cc-admin-list-section-head {
    margin: 0;
}

body.admin-shell .cc-admin-panel-head h2,
body.admin-shell .cc-admin-panel-head h3,
body.admin-shell .cc-settings-section-head h2,
body.admin-shell .cc-users-section-head h2,
body.admin-shell .cc-logs-section-head h2,
body.admin-shell .cc-admin-list-section-head h2,
body.admin-shell .cc-plugin-section > .cc-plugin-section-head h2,
body.admin-shell .cc-plugin-section > .cc-admin-section-header h2,
body.admin-shell .cc-security-section > .cc-security-section-head h2,
body.admin-shell .cc-health-section > .cc-admin-section-header h2 {
    margin: 0;
    color: var(--cc-panel-header-text);
    font-size: var(--cc-admin-type-section-title);
    font-weight: 780;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

body.admin-shell .cc-admin-panel-head p,
body.admin-shell .cc-settings-section-head p,
body.admin-shell .cc-users-section-head p,
body.admin-shell .cc-logs-section-head p,
body.admin-shell .cc-admin-list-section-head p,
body.admin-shell .cc-plugin-section > .cc-plugin-section-head p,
body.admin-shell .cc-plugin-section > .cc-admin-section-header p,
body.admin-shell .cc-security-section > .cc-security-section-head p,
body.admin-shell .cc-health-section > .cc-admin-section-header p,
body.admin-shell .cc-admin-panel-head .cc-admin-section-kicker,
body.admin-shell .cc-health-section > .cc-admin-section-header .cc-admin-section-kicker {
    color: var(--cc-panel-header-muted);
}

body.admin-shell .cc-admin-panel-head p,
body.admin-shell .cc-settings-section-head p,
body.admin-shell .cc-users-section-head p,
body.admin-shell .cc-logs-section-head p,
body.admin-shell .cc-admin-list-section-head p,
body.admin-shell .cc-plugin-section > .cc-plugin-section-head p,
body.admin-shell .cc-plugin-section > .cc-admin-section-header p,
body.admin-shell .cc-security-section > .cc-security-section-head p,
body.admin-shell .cc-health-section > .cc-admin-section-header p {
    max-width: 70rem;
    margin: 0.3rem 0 0;
    font-size: var(--cc-admin-type-help);
    line-height: 1.55;
    opacity: 1;
}

/* Older feature views frequently expose a direct card title instead of a
 * structured panel header. Treat that direct title as the same header slab so
 * fallback and plugin views cannot drift into another visual language. */
body.admin-shell .card > .cc-admin-card-title:first-child,
body.admin-shell .cc-admin-form-card > .card-title,
body.admin-shell .cc-admin-form-card > h2:first-child,
body.admin-shell .cc-admin-form-card > h3:first-child,
body.admin-shell .cc-admin-form-card > h4:first-child {
    margin: -1.5rem -1.5rem 1.5rem;
    padding: 1.2rem 1.5rem;
    color: var(--cc-panel-header-text);
    background: var(--cc-panel-header-bg);
    border: 0;
    border-bottom: 0.3rem solid var(--admin-primary);
    font-size: var(--cc-admin-type-section-title);
    font-weight: 780;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

body.admin-shell .card.cc-admin-panel--flush > .cc-admin-card-title:first-child {
    margin: 0;
}

body.admin-shell .cc-admin-panel-body {
    min-width: 0;
}

body.admin-shell .cc-admin-panel-footer {
    margin: 1.5rem -1.5rem -1.5rem;
    padding: 1rem 1.5rem;
    background: var(--admin-bg-subtle);
    border-top: 1px solid var(--admin-border);
}

body.admin-shell .cc-admin-panel--flush > .cc-admin-panel-footer {
    margin: 0;
}

/* Plugin cards use the same dark header slab instead of an orange top edge. */
body.admin-shell .cc-plugin-section > .cc-plugin-section-head {
    padding-bottom: 1.2rem;
}

body.admin-shell .cc-plugin-section > .cc-plugin-section-head .cc-plugin-title,
body.admin-shell .cc-plugin-section > .cc-plugin-section-head .cc-plugin-title a {
    color: var(--cc-panel-header-text);
}

body.admin-shell .cc-plugin-section > .cc-plugin-section-head .cc-plugin-description {
    color: var(--cc-panel-header-muted);
}

body.admin-shell .cc-plugin-section > .cc-plugin-section-head .badge-dark {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.24);
}

/* Nested security cards remain light. Only top-level feature sections carry
 * the graphite slab, preventing a page from becoming a stack of dark boxes. */
body.admin-shell .cc-security-section .cc-security-migration-card > .cc-security-section-head,
body.admin-shell .cc-security-section .cc-security-schema-card > .cc-security-section-head,
body.admin-shell .cc-security-section .cc-security-block-form > .cc-security-section-head {
    margin: 0 0 0.9rem;
    padding: 0 0 0.8rem;
    color: var(--admin-text-strong);
    background: transparent;
    border-bottom: 1px solid var(--admin-border);
}

body.admin-shell .cc-security-section .cc-security-migration-card > .cc-security-section-head h3,
body.admin-shell .cc-security-section .cc-security-schema-card > .cc-security-section-head h3,
body.admin-shell .cc-security-section .cc-security-block-form > .cc-security-section-head h3 {
    color: var(--admin-text-strong);
}

body.admin-shell .cc-security-section .cc-admin-filter-card {
    margin-bottom: 1rem;
}

body.admin-shell .cc-health-section > .cc-admin-section-header .cc-admin-section-kicker {
    opacity: 0.74;
}

/* Shared table treatment for all list views. */
body.admin-shell .cc-admin-panel--flush > .table-responsive,
body.admin-shell .cc-admin-panel--flush > table,
body.admin-shell .cc-admin-list-card > .table-responsive,
body.admin-shell .cc-admin-list-card > table {
    margin: 0;
}

body.admin-shell .cc-admin-panel--flush table thead,
body.admin-shell .cc-admin-list-card table thead {
    background: var(--admin-bg-subtle);
}

.cc-plugin-host-surface {
    display: grid;
    gap: 1.5rem;
}

/* --------------------------------------------------------------------------
   ADMIN-R1.3b-5 – Auth / exceptional surface closure
   Error pages share the same static CSS contract instead of carrying three
   duplicated nonce-scoped style blocks in the views.
   -------------------------------------------------------------------------- */
.error-page {
    display: flex;
    min-height: 62vh;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem 4rem;
}

body.admin-shell .error-card {
    position: relative;
    width: 100%;
    max-width: 76rem;
    overflow: hidden;
    text-align: center;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    box-shadow: var(--admin-elevation-2);
}

.error-code {
    position: absolute;
    z-index: 0;
    top: -1.5rem;
    left: 50%;
    margin: 0;
    color: rgba(0, 0, 0, 0.045);
    font-size: clamp(7rem, 20vw, 13rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.06em;
    pointer-events: none;
    user-select: none;
    transform: translateX(-50%);
}

body.admin-shell .error-card .error-content {
    position: relative;
    z-index: 1;
    padding: 4.5rem 2rem 2.25rem;
}

body.admin-shell .error-card .error-icon {
    display: flex;
    width: 6.4rem;
    height: 6.4rem;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: #ffffff;
    background: var(--cc-panel-header-bg);
    border-radius: 1rem;
    box-shadow: var(--admin-elevation-2);
}

.error-title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.error-description {
    max-width: 56rem;
    margin: 0 auto;
    line-height: 1.7;
}

.error-details,
.error-path {
    max-width: 56rem;
    margin: 1.25rem auto 0;
    overflow-wrap: anywhere;
}

.error-details {
    padding: 1rem 1.25rem;
    text-align: left;
    border-left: 0.4rem solid var(--admin-warning);
    border-radius: 0.35rem;
    background: var(--admin-warning-soft);
}

.error-details--danger {
    border-left-color: var(--admin-danger);
    background: var(--admin-danger-soft);
}

.error-details strong {
    display: block;
    margin-bottom: 0.25rem;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.error-actions .button {
    min-width: 16rem;
    margin: 0;
}

.error-actions .button-back {
    min-width: 13rem;
}

@media (max-width: 640px) {
    body.admin-shell .error-card .error-content {
        padding: 4rem 1.25rem 1.75rem;
    }

    .error-actions {
        flex-direction: column;
    }

    .error-actions .button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    body.admin-shell .cc-admin-panel-head,
    body.admin-shell .cc-settings-section-head,
    body.admin-shell .cc-users-section-head,
    body.admin-shell .cc-logs-section-head,
    body.admin-shell .cc-plugin-section > .cc-plugin-section-head,
    body.admin-shell .cc-plugin-section > .cc-admin-section-header,
    body.admin-shell .cc-security-section > .cc-security-section-head,
    body.admin-shell .cc-health-section > .cc-admin-section-header,
    body.admin-shell .cc-admin-list-section-head {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==========================================================================
   ADMIN-R1.3b-4 – visual correction pass 1
   Auth branding is integrated into the card, icon-only actions share one
   square footprint, and user/role editors use the same compact surface rhythm
   as Settings. The system-wide hierarchy remains graphite + orange.
   ========================================================================== */

/* Auth: never place the product mark beside the card. */
.auth-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.auth-header .auth-brand-mark {
    width: 4.8rem;
    height: 4.8rem;
    margin: 0 auto 1.35rem;
    border-radius: 1rem;
}

.auth-header .auth-brand-logo {
    width: 3.7rem;
    height: 3.7rem;
}

/* Tables: icon-only edit/delete/lock controls must be optically identical. */
body.admin-shell .cc-icon-button,
body.admin-shell .cc-admin-inline-actions .cc-icon-button {
    display: inline-flex;
    flex: 0 0 3.4rem;
    width: 3.4rem;
    min-width: 3.4rem;
    height: 3.4rem;
    min-height: 3.4rem;
    padding: 0;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 0.85rem;
}

body.admin-shell .cc-icon-button .cc-icon,
body.admin-shell .cc-admin-inline-actions .cc-icon-button .cc-icon {
    width: 1.65rem;
    height: 1.65rem;
}

body.admin-shell td.actions-cell {
    width: 9.6rem;
    min-width: 9.6rem;
    padding-right: 1.35rem;
    padding-left: 1.35rem;
}

body.admin-shell td.actions-cell .cc-admin-inline-actions {
    justify-content: center;
}

body.admin-shell .cc-admin-inline-actions > form {
    display: inline-flex;
    align-items: center;
}

/* User and role editors: Settings-like density instead of legacy large cards. */
body.admin-shell .cc-admin-editor-grid {
    gap: 1.25rem;
}

body.admin-shell .cc-admin-editor-grid > [class^="col-"],
body.admin-shell .cc-admin-editor-grid > [class*=" col-"] {
    min-width: 0;
}

body.admin-shell .cc-admin-form-card {
    padding: 1.5rem;
}

body.admin-shell .cc-admin-editor-grid .form-group {
    margin-bottom: 1.35rem;
}

body.admin-shell #userForm .pw-checklist,
body.admin-shell #userForm .permission-lock-card,
body.admin-shell #roleForm .permission-lock-card {
    background: var(--admin-bg-subtle);
    border-color: var(--admin-border);
    border-radius: var(--admin-radius-md);
}

/* Plugin metadata fills its full row; no white holes after optional fields. */
body.admin-shell .cc-plugin-meta-grid {
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    background: var(--admin-bg-subtle);
}

body.admin-shell .cc-plugin-meta-grid > div {
    background: var(--admin-bg-subtle);
}

@media (max-width: 900px) {
    body.admin-shell .cc-plugin-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body.admin-shell .cc-plugin-meta-grid {
        grid-template-columns: 1fr;
    }

    body.admin-shell td.actions-cell {
        width: 8.6rem;
        min-width: 8.6rem;
        padding-right: 0.8rem;
        padding-left: 0.8rem;
    }
}

/* System hub: real breadcrumb parent for /admin/system/* routes. */
body.admin-shell .cc-system-hub-runtime,
body.admin-shell .cc-system-hub-areas {
    margin-bottom: 1.25rem;
}

body.admin-shell .cc-system-hub-runtime-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    overflow: hidden;
    background: var(--admin-bg-subtle);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
}

body.admin-shell .cc-system-hub-runtime-grid > div {
    min-width: 0;
    padding: 1rem 1.1rem;
    border-right: 1px solid var(--admin-border);
}

body.admin-shell .cc-system-hub-runtime-grid > div:last-child {
    border-right: 0;
}

body.admin-shell .cc-system-hub-runtime-grid dt {
    margin: 0 0 0.3rem;
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-meta);
    font-weight: 720;
}

body.admin-shell .cc-system-hub-runtime-grid dd {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: var(--cc-admin-type-body);
    font-weight: 720;
    overflow-wrap: anywhere;
}

body.admin-shell .cc-system-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

body.admin-shell .cc-system-hub-card {
    display: grid;
    grid-template-columns: 4.2rem minmax(0, 1fr) auto;
    gap: 0.9rem;
    align-items: center;
    min-width: 0;
    padding: 1rem;
    color: var(--admin-text-strong);
    background: linear-gradient(180deg, #ffffff, color-mix(in srgb, var(--admin-bg-subtle) 45%, #ffffff));
    border: 1px solid var(--admin-border);
    border-radius: 1rem;
    box-shadow: var(--admin-elevation-1);
    text-decoration: none;
    transform: none;
}

body.admin-shell .cc-system-hub-card:hover,
body.admin-shell .cc-system-hub-card:focus-visible {
    color: var(--admin-text-strong);
    background: var(--admin-primary-soft);
    border-color: var(--admin-primary-border);
    box-shadow: var(--admin-elevation-2);
    transform: none;
}

body.admin-shell .cc-system-hub-icon {
    display: grid;
    place-items: center;
    width: 4.2rem;
    height: 4.2rem;
    color: #ffffff;
    background: var(--admin-surface-dark);
    border-radius: 1rem;
}

body.admin-shell .cc-system-hub-copy {
    display: grid;
    min-width: 0;
    gap: 0.25rem;
}

body.admin-shell .cc-system-hub-copy strong {
    color: var(--admin-text-strong);
    font-size: var(--cc-admin-type-body);
    font-weight: 760;
}

body.admin-shell .cc-system-hub-copy small {
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-help);
    line-height: 1.5;
}

body.admin-shell .cc-system-hub-open {
    color: var(--admin-interactive-text);
    font-size: var(--cc-admin-type-help);
    font-weight: 720;
    white-space: nowrap;
}

@media (max-width: 900px) {
    body.admin-shell .cc-system-hub-runtime-grid,
    body.admin-shell .cc-system-hub-grid {
        grid-template-columns: 1fr 1fr;
    }

    body.admin-shell .cc-system-hub-runtime-grid > div:nth-child(2) {
        border-right: 0;
    }

    body.admin-shell .cc-system-hub-runtime-grid > div:nth-child(-n + 2) {
        border-bottom: 1px solid var(--admin-border);
    }
}

@media (max-width: 640px) {
    body.admin-shell .cc-system-hub-runtime-grid,
    body.admin-shell .cc-system-hub-grid {
        grid-template-columns: 1fr;
    }

    body.admin-shell .cc-system-hub-runtime-grid > div,
    body.admin-shell .cc-system-hub-runtime-grid > div:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid var(--admin-border);
    }

    body.admin-shell .cc-system-hub-runtime-grid > div:last-child {
        border-bottom: 0;
    }

    body.admin-shell .cc-system-hub-card {
        grid-template-columns: 4.2rem minmax(0, 1fr);
    }

    body.admin-shell .cc-system-hub-open {
        grid-column: 2;
    }
}

/* ==========================================================================
   ADMIN-R1.3b-4 – System Hub / Live-Systemtests
   Explicit operational probes remain visually and semantically separated
   from passive diagnostics. No destructive test surface is exposed here.
   ========================================================================== */
body.admin-shell .cc-system-hub-last-test {
    display: block;
    margin-top: 0.35rem;
    color: var(--admin-text-soft);
    font-size: var(--cc-admin-type-meta);
    line-height: 1.4;
}

body.admin-shell .cc-system-hub-last-test.is-passed {
    color: var(--admin-success);
}

body.admin-shell .cc-system-hub-last-test.is-warning {
    color: var(--admin-warning);
}

body.admin-shell .cc-system-hub-last-test.is-failed {
    color: var(--admin-danger);
}

body.admin-shell .cc-system-tests-overview,
body.admin-shell .cc-system-tests-results,
body.admin-shell .cc-system-tests-catalog {
    margin-bottom: 1.25rem;
}

body.admin-shell .cc-system-tests-safety-grid,
body.admin-shell .cc-system-tests-catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

body.admin-shell .cc-system-tests-safety-card,
body.admin-shell .cc-system-test-card,
body.admin-shell .cc-system-test-result {
    min-width: 0;
    padding: 1rem;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 1rem;
    box-shadow: var(--admin-elevation-1);
}

body.admin-shell .cc-system-tests-safety-card {
    display: grid;
    align-content: start;
    gap: 0.55rem;
}

body.admin-shell .cc-system-tests-safety-card.is-safe {
    border-left: 4px solid var(--admin-info);
}

body.admin-shell .cc-system-tests-safety-card.is-controlled {
    border-left: 4px solid var(--admin-warning);
}

body.admin-shell .cc-system-tests-safety-card strong,
body.admin-shell .cc-system-test-card h3,
body.admin-shell .cc-system-test-result h3 {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: var(--cc-admin-type-body);
    font-weight: 760;
    line-height: 1.35;
}

body.admin-shell .cc-system-tests-safety-card p,
body.admin-shell .cc-system-test-card p,
body.admin-shell .cc-system-test-result p {
    margin: 0;
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-help);
    line-height: 1.55;
}

body.admin-shell .cc-system-tests-run-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1rem;
}

body.admin-shell .cc-system-tests-run-actions form,
body.admin-shell .cc-system-test-single-form {
    margin: 0;
}

body.admin-shell .cc-system-tests-result-state,
body.admin-shell .cc-system-test-status {
    display: inline-flex;
    align-items: center;
    min-height: 2.6rem;
    padding: 0.35rem 0.7rem;
    border-radius: var(--admin-radius-pill);
    font-size: var(--cc-admin-type-meta);
    font-weight: 760;
    white-space: nowrap;
}

body.admin-shell .cc-system-tests-result-state.is-passed,
body.admin-shell .cc-system-test-status.is-passed {
    color: #067647;
    background: var(--admin-success-soft);
}

body.admin-shell .cc-system-tests-result-state.is-warning,
body.admin-shell .cc-system-test-status.is-warning,
body.admin-shell .cc-system-test-status.is-skipped {
    color: #9a6700;
    background: var(--admin-warning-soft);
}

body.admin-shell .cc-system-tests-result-state.is-failed,
body.admin-shell .cc-system-test-status.is-failed {
    color: #b42318;
    background: var(--admin-danger-soft);
}

body.admin-shell .cc-system-tests-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 1rem;
    overflow: hidden;
    background: var(--admin-bg-subtle);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
}

body.admin-shell .cc-system-tests-summary-grid > div {
    min-width: 0;
    padding: 0.9rem 1rem;
    border-right: 1px solid var(--admin-border);
}

body.admin-shell .cc-system-tests-summary-grid > div:last-child {
    border-right: 0;
}

body.admin-shell .cc-system-tests-summary-grid dt {
    margin: 0 0 0.25rem;
    color: var(--admin-text-muted);
    font-size: var(--cc-admin-type-meta);
    font-weight: 700;
}

body.admin-shell .cc-system-tests-summary-grid dd {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
}

body.admin-shell .cc-system-tests-result-list {
    display: grid;
    gap: 0.75rem;
}

body.admin-shell .cc-system-test-result {
    border-left-width: 4px;
}

body.admin-shell .cc-system-test-result.is-passed {
    border-left-color: var(--admin-success);
}

body.admin-shell .cc-system-test-result.is-warning,
body.admin-shell .cc-system-test-result.is-skipped {
    border-left-color: var(--admin-warning);
}

body.admin-shell .cc-system-test-result.is-failed {
    border-left-color: var(--admin-danger);
}

body.admin-shell .cc-system-test-result-head,
body.admin-shell .cc-system-test-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

body.admin-shell .cc-system-test-result-head {
    margin-bottom: 0.55rem;
}

body.admin-shell .cc-system-test-meta,
body.admin-shell .cc-system-test-group,
body.admin-shell .cc-system-test-result small {
    color: var(--admin-text-soft);
    font-size: var(--cc-admin-type-meta);
    font-weight: 650;
}

body.admin-shell .cc-system-test-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transform: none;
}

body.admin-shell .cc-system-test-card:hover {
    border-color: var(--admin-border);
    box-shadow: var(--admin-elevation-1);
    transform: none;
}

body.admin-shell .cc-system-test-card .badge.is-controlled {
    color: #9a6700;
    background: var(--admin-warning-soft);
}

body.admin-shell .cc-system-test-card .badge.is-safe {
    color: var(--admin-text-strong);
    background: var(--admin-bg-subtle);
}

body.admin-shell .cc-system-test-single-form {
    margin-top: auto;
    padding-top: 0.25rem;
}

body.admin-shell .cc-system-tests-destructive-note {
    margin-top: 1.25rem;
}

@media (max-width: 900px) {
    body.admin-shell .cc-system-tests-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.admin-shell .cc-system-tests-summary-grid > div:nth-child(3) {
        border-right: 0;
    }

    body.admin-shell .cc-system-tests-summary-grid > div:nth-child(-n + 3) {
        border-bottom: 1px solid var(--admin-border);
    }
}

@media (max-width: 640px) {
    body.admin-shell .cc-system-tests-safety-grid,
    body.admin-shell .cc-system-tests-catalog-grid,
    body.admin-shell .cc-system-tests-summary-grid {
        grid-template-columns: 1fr;
    }

    body.admin-shell .cc-system-tests-summary-grid > div,
    body.admin-shell .cc-system-tests-summary-grid > div:nth-child(3) {
        border-right: 0;
        border-bottom: 1px solid var(--admin-border);
    }

    body.admin-shell .cc-system-tests-summary-grid > div:last-child {
        border-bottom: 0;
    }

    body.admin-shell .cc-system-tests-run-actions,
    body.admin-shell .cc-system-tests-run-actions form,
    body.admin-shell .cc-system-tests-run-actions .button,
    body.admin-shell .cc-system-test-single-form,
    body.admin-shell .cc-system-test-single-form .button {
        width: 100%;
    }
}

/* ==========================================================================
   ADMIN-R1.3b-4 – visual correction pass 2
   Final alignment pass for Pages tables, role editor surfaces and Dashboard
   System access. Roles & Rights remains the table alignment reference.
   ========================================================================== */

body.admin-shell .cc-admin-reference-table {
    width: 100%;
    min-width: 72rem;
    table-layout: fixed;
}

body.admin-shell .cc-admin-reference-table th,
body.admin-shell .cc-admin-reference-table td {
    vertical-align: middle;
}

body.admin-shell .cc-admin-reference-table th {
    padding-top: 1.15rem;
    padding-bottom: 1.15rem;
}

body.admin-shell .cc-admin-reference-table .cc-table-actions-column {
    width: 9.6rem;
    min-width: 9.6rem;
    padding-right: 1.35rem;
    padding-left: 1.35rem;
    text-align: center;
}

body.admin-shell .cc-admin-reference-table .actions-cell .cc-admin-inline-actions {
    justify-content: center;
}

body.admin-shell .cc-pages-table .cc-table-drag-column {
    width: 4rem;
}

body.admin-shell .cc-pages-table .cc-pages-title-column {
    width: 40%;
}

body.admin-shell .cc-pages-table .cc-pages-status-column {
    width: 18%;
}

body.admin-shell .cc-pages-table .cc-pages-slug-column {
    width: auto;
}

body.admin-shell .cc-trash-table .cc-trash-page-column {
    width: 44%;
}

body.admin-shell .cc-trash-table .cc-trash-status-column {
    width: 18%;
}

body.admin-shell .cc-trash-table .cc-trash-date-column {
    width: auto;
}

body.admin-shell .cc-categories-table .cc-categories-name-column {
    width: 34%;
}

body.admin-shell .cc-categories-table .cc-categories-description-column {
    width: auto;
}

/* Role editor: selectable capabilities read as admin controls, not legacy
 * beige utility blocks. */
body.admin-shell #roleForm .cc-role-editor-card {
    overflow: hidden;
}

body.admin-shell #roleForm .cc-role-system-access-card .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

body.admin-shell #roleForm .cc-role-access-tile {
    min-width: 0;
    min-height: 7.2rem;
    padding: 1rem 1.1rem;
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-sm);
    box-shadow: var(--shadow-xs);
}

body.admin-shell #roleForm .cc-role-access-tile:hover {
    border-color: var(--admin-primary-border);
    box-shadow: var(--shadow-xs);
}

body.admin-shell #roleForm .cc-role-access-label {
    gap: 0.7rem;
    color: var(--admin-text-strong);
    font-size: 1.2rem;
    font-weight: 720;
    line-height: 1.4;
}

body.admin-shell #roleForm .cc-role-access-label input[type="checkbox"],
body.admin-shell #roleForm .cc-role-permission-table input[type="checkbox"],
body.admin-shell #roleForm .action-capability-item input[type="checkbox"] {
    accent-color: var(--admin-primary);
}

body.admin-shell #roleForm .cc-role-access-code {
    margin-top: 0.7rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--admin-border);
    line-height: 1.45;
}

body.admin-shell #roleForm .cc-role-access-code code,
body.admin-shell #roleForm .permission-module-id,
body.admin-shell #roleForm .action-capability-item code {
    color: var(--admin-text-muted);
    background: var(--admin-bg-subtle);
    border-radius: 0.45rem;
}

body.admin-shell #roleForm .cc-role-permission-table {
    border-collapse: collapse;
}

body.admin-shell #roleForm .cc-role-permission-table thead th {
    background: color-mix(in srgb, var(--admin-primary) 5%, #ffffff);
}

body.admin-shell #roleForm .cc-role-permission-table .matrix-category-row td {
    padding: 0.9rem 1.25rem;
    color: var(--admin-text-strong);
    background: var(--admin-bg-subtle);
    border-top: 1px solid var(--admin-border);
    border-bottom: 1px solid var(--admin-border);
}

body.admin-shell #roleForm .cc-role-permission-table td {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

body.admin-shell #roleForm .action-capabilities {
    margin-top: 0.9rem;
    padding-top: 0.8rem;
    border-top-color: var(--admin-border);
}

body.admin-shell #roleForm .action-capability-item {
    min-height: 3.2rem;
    padding: 0.5rem 0.7rem;
    background: #ffffff;
    border-color: var(--admin-border);
    border-radius: 0.7rem;
}

body.admin-shell #roleForm .cc-role-editor-note {
    background: var(--admin-surface);
}

body.admin-shell #roleForm .cc-role-editor-note > h4:first-child {
    margin: -1.5rem -1.5rem 1.1rem;
    padding: 1rem 1.5rem;
    color: var(--cc-panel-header-text);
    background: var(--cc-panel-header-bg);
    border-bottom: 0.3rem solid var(--admin-primary);
    font-size: 1.1rem;
    font-weight: 760;
    letter-spacing: 0;
    text-transform: none;
}

body.admin-shell #roleForm .system-role-notice {
    border-left: 1px solid var(--admin-border);
}

@media (max-width: 900px) {
    body.admin-shell #roleForm .cc-role-system-access-card .grid-2 {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   ADMIN-R1.6 – responsive and accessibility closure
   ========================================================================== */

.cc-skip-link {
    position: fixed;
    top: 0.8rem;
    left: 0.8rem;
    z-index: 1000;
    padding: 0.8rem 1.1rem;
    color: #ffffff;
    background: var(--admin-surface-dark);
    border: 2px solid var(--admin-interactive-text);
    border-radius: var(--admin-radius-sm);
    box-shadow: var(--admin-elevation-3);
    font-weight: 750;
    text-decoration: none;
    transform: translateY(calc(-100% - 1.6rem));
}

.cc-skip-link:focus,
.cc-skip-link:focus-visible {
    color: #ffffff;
    outline: 3px solid var(--admin-interactive-text);
    outline-offset: 2px;
    transform: translateY(0);
}

#admin-main-content:focus {
    outline: none;
}

body.admin-shell .cc-admin-tabs [role="tab"][aria-selected="true"] {
    color: var(--admin-text-strong);
}

body.admin-shell .cc-admin-tabs [role="tab"]:focus-visible {
    position: relative;
    z-index: 1;
}

@media (max-width: 640px) {
    body.admin-shell .cc-admin-dialog {
        max-width: calc(100vw - 1rem);
    }
}

/* EXT-P8.11: Plugin notifications ----------------------------------------- */
.cc-plugin-notification-stack {
    display: grid;
    gap: 0.9rem;
    margin: 0 0 1.6rem;
}

.cc-plugin-notification {
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--admin-border);
    border-left-width: 0.45rem;
    border-radius: var(--admin-radius-md);
    background: var(--admin-surface);
    box-shadow: var(--shadow-sm);
}

.cc-plugin-notification p {
    margin: 0;
    color: var(--admin-text-strong);
    line-height: 1.5;
}

.cc-plugin-notification--info {
    border-left-color: #2563eb;
}

.cc-plugin-notification--success {
    border-left-color: #079455;
}

.cc-plugin-notification--warning {
    border-left-color: #f79009;
}

.cc-plugin-notification--error {
    border-left-color: #d92d20;
}

/* ==========================================================
   EXT-P8.37 – Multi-Level Plugin Admin Navigation
   ========================================================== */

.nav-tree-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.35rem;
}

.nav-tree-row > .nav-link {
    min-width: 0;
}

.nav-submenu-toggle {
    display: grid;
    place-items: center;
    width: 3.2rem;
    height: 3.2rem;
    padding: 0;
    color: #aeb6b8;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.8rem;
    cursor: pointer;
    transition:
        color var(--admin-motion-fast) var(--admin-motion-ease),
        background-color var(--admin-motion-fast) var(--admin-motion-ease),
        border-color var(--admin-motion-fast) var(--admin-motion-ease);
}

.nav-submenu-toggle:hover,
.nav-submenu-toggle:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.09);
}

.nav-submenu-toggle .cc-icon {
    width: 1.55rem;
    height: 1.55rem;
    transition: transform var(--admin-motion-fast) var(--admin-motion-ease);
}

.nav-submenu-toggle[aria-expanded="true"] .cc-icon {
    transform: rotate(180deg);
}

.nav-submenu[hidden] {
    display: none;
}

.nav-submenu {
    margin: 0.15rem 0 0.4rem 2.45rem;
    padding-left: 0.7rem;
    border-left: 1px solid rgba(255, 255, 255, 0.09);
}

.nav-submenu-level-2 {
    margin-left: 2rem;
}

.nav-link-sub {
    min-height: 3.9rem;
    margin-block: 0.12rem;
    padding: 0.58rem 0.72rem;
    font-size: 1.25rem;
}

.nav-link-sub .nav-link-icon {
    flex-basis: 2.55rem;
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 0.68rem;
}

.nav-link-sub .nav-link-icon .cc-icon {
    width: 1.65rem;
    height: 1.65rem;
}

.nav-link-sub-level-2 {
    font-size: 1.2rem;
}

.nav-link-ancestor-active:not(.nav-link-active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.07);
}

body.sidebar-collapsed .nav-submenu,
body.sidebar-collapsed .nav-submenu-toggle {
    display: none !important;
}

body.sidebar-collapsed .nav-tree-row {
    display: block;
}

@media (max-width: 1024px) {
    .nav-submenu-toggle {
        width: 3.6rem;
        height: 3.6rem;
    }

    .nav-submenu {
        margin-left: 2.2rem;
    }
}

/* ==========================================================
   EXT-P8.38 – Public Plugin Admin UI Components
   ========================================================== */

.cc-plugin-admin-ui {
    display: grid;
    gap: 1.5rem;
}

.cc-plugin-admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.cc-plugin-admin-page-header h1 {
    margin-bottom: 0.35rem;
}

.cc-plugin-admin-page-header p {
    margin: 0;
    color: var(--admin-text-muted);
}

.cc-admin-page-kicker {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--admin-primary);
    font-size: 0.82rem;
    font-weight: 780;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cc-admin-page-actions,
.cc-plugin-admin-toolbar,
.cc-plugin-admin-filter-actions,
.cc-plugin-admin-empty-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
}

.cc-admin-page-actions {
    justify-content: flex-end;
}

.cc-plugin-admin-action-form {
    margin: 0;
}

.cc-plugin-admin-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.cc-plugin-admin-tabs .cc-plugin-admin-tab {
    display: inline-flex;
    min-height: 3.6rem;
    align-items: center;
    padding: 0.7rem 1rem;
    color: var(--admin-text-muted);
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 0.8rem;
    font-weight: 700;
    text-decoration: none;
}

.cc-plugin-admin-tabs .cc-plugin-admin-tab:hover,
.cc-plugin-admin-tabs .cc-plugin-admin-tab:focus-visible,
.cc-plugin-admin-tabs .cc-plugin-admin-tab.is-active {
    color: var(--admin-text-strong);
    border-color: var(--admin-primary-border);
}

.cc-plugin-admin-tabs .cc-plugin-admin-tab.is-active {
    background: var(--admin-primary-soft);
    box-shadow: inset 0 -0.2rem 0 var(--admin-primary);
}

.cc-plugin-admin-field {
    margin: 0;
}

.cc-plugin-admin-help {
    display: block;
    margin-top: 0.45rem;
    color: var(--admin-text-muted);
    line-height: 1.5;
}

.cc-plugin-admin-filter-card {
    padding: 1.25rem;
}

.cc-plugin-admin-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    align-items: end;
    gap: 1rem;
}

.cc-plugin-admin-filter-actions {
    align-self: end;
}

.cc-plugin-admin-table table {
    margin-bottom: 0;
}

.cc-plugin-admin-cell-primary,
.cc-plugin-admin-cell-secondary {
    display: block;
}

.cc-plugin-admin-cell-secondary {
    margin-top: 0.25rem;
    color: var(--admin-text-muted);
}

.cc-plugin-admin-table-actions {
    justify-content: flex-start;
}

.cc-plugin-admin-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
}

.cc-plugin-admin-pagination .button {
    margin: 0;
}

.cc-plugin-admin-pagination .is-active {
    color: #ffffff;
    background: var(--admin-primary);
    border-color: var(--admin-primary);
}

.cc-plugin-admin-notice.is-success {
    border-color: color-mix(in srgb, #15803d 30%, var(--admin-border));
    border-left-color: #15803d;
}

.cc-plugin-admin-notice.is-warning {
    border-color: color-mix(in srgb, #b54708 30%, var(--admin-border));
    border-left-color: #b54708;
}

.cc-plugin-admin-notice.is-danger {
    border-color: color-mix(in srgb, #b42318 30%, var(--admin-border));
    border-left-color: #b42318;
}

.cc-plugin-admin-media-preview {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--admin-bg-subtle);
    border: 1px solid var(--admin-border);
    border-radius: 0.8rem;
}

.cc-plugin-admin-media-preview[hidden] {
    display: none;
}

.cc-plugin-admin-media-preview img {
    display: block;
    width: min(100%, 18rem);
    height: auto;
    border-radius: 0.6rem;
}

.cc-plugin-admin-dialog {
    width: min(42rem, calc(100vw - 2rem));
    max-height: min(84vh, 52rem);
    padding: 0;
}

.cc-plugin-admin-dialog-panel {
    display: grid;
    gap: 0;
    margin: 0;
}

.cc-plugin-admin-dialog-panel > header,
.cc-plugin-admin-dialog-panel > footer,
.cc-plugin-admin-dialog > .cc-plugin-admin-dialog-panel > header,
.cc-plugin-admin-dialog > .cc-plugin-admin-dialog-panel > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.cc-plugin-admin-dialog-panel > header {
    border-bottom: 1px solid var(--admin-border);
}

.cc-plugin-admin-dialog-panel > footer {
    justify-content: flex-end;
    border-top: 1px solid var(--admin-border);
}

.cc-plugin-admin-dialog-panel h2 {
    margin: 0;
}

.cc-plugin-admin-dialog-content {
    overflow: auto;
    padding: 1.25rem;
}

@media (max-width: 650px) {
    .cc-plugin-admin-page-header {
        flex-direction: column;
    }

    .cc-admin-page-actions,
    .cc-plugin-admin-toolbar,
    .cc-plugin-admin-filter-actions {
        width: 100%;
        justify-content: stretch;
    }

    .cc-admin-page-actions > *,
    .cc-plugin-admin-toolbar > *,
    .cc-plugin-admin-filter-actions > *,
    .cc-admin-page-actions .button,
    .cc-plugin-admin-toolbar .button,
    .cc-plugin-admin-filter-actions .button {
        flex: 1 1 100%;
        width: 100%;
    }
}
