/* KANZLEI OS - Stylesheet | @author FatumDev (fatumdev.de) */
/* ============================================================
 *  KANZLEI OS - HAUPTSTYLESHEET
 * ============================================================
 *  Aufbau dieser Datei:
 *  1. CSS-Variablen (Farben, Abstände, Schriften)
 *  2. Basis-Styles (Body, Scrollbar)
 *  3. OS Desktop (Hintergrund, Grid)
 *  4. Fenster-System (Titlebar, Controls, Sidebar)
 *  5. Taskbar (unten, immer sichtbar)
 *  6. Start-Menü (Popup)
 *  7. Benachrichtigungen (Dropdown)
 *  8. Desktop-Icons (App-Icons auf dem Desktop)
 *  9. Login/Registrierung (Sperrbildschirm)
 * 10. Karten & Tabellen (Cards, Badges, Buttons)
 * 11. App-Verwaltung (Toggle-Switches)
 * 12. Formulare (Inputs, Selects, Labels)
 * 13. Animationen (Fenster öffnen, Toast)
 * ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #3838ad;
    --sidebar-bg: rgba(19, 19, 24, 0.85);
    --card-bg: rgba(90, 90, 185, 0.9);
    --accent: #636363;
    --accent-hover: #c49a3a;
    --accent-glow: rgba(212, 168, 67, 0.15);
    --text-primary: #e8e4dc;
    --text-secondary: #7a7568;
    --border: rgba(212, 168, 67, 0.12);
    --glass: rgba(212, 168, 67, 0.03);
    --glass-border: rgba(212, 168, 67, 0.10);
    --danger: #ef4444;
    --success: #10b981;
    --taskbar-h: 54px;
    --win-radius: 12px;
    --fs: 1;
    --fs-6: calc(6px * var(--fs));
    --fs-7: calc(7px * var(--fs));
    --fs-8: calc(8px * var(--fs));
    --fs-9: calc(9px * var(--fs));
    --fs-10: calc(10px * var(--fs));
    --fs-11: calc(11px * var(--fs));
    --fs-12: calc(12px * var(--fs));
    --fs-13: calc(13px * var(--fs));
    --fs-14: calc(14px * var(--fs));
    --fs-15: calc(15px * var(--fs));
    --fs-16: calc(16px * var(--fs));
    --fs-18: calc(18px * var(--fs));
    --fs-20: calc(20px * var(--fs));
    --fs-22: calc(22px * var(--fs));
    --fs-28: calc(28px * var(--fs));
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* --- OS DESKTOP: Hintergrund mit Gradient und Grid --- */
.os-desktop {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(212, 168, 67, 0.04) 0%, #0d0d12 60%);
    overflow: hidden;
}

.os-desktop::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 800px 600px at 20% 30%, rgba(212, 168, 67, 0.05), transparent),
        radial-gradient(ellipse 600px 500px at 80% 70%, rgba(180, 140, 50, 0.03), transparent);
    pointer-events: none;
    z-index: 0;
}

.os-desktop-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(212, 168, 67, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 168, 67, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* --- TASKBAR: Fixierte Leiste am unteren Rand --- */
.os-taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--taskbar-h);
    background: rgba(13, 13, 18, 0.92);
    border-top: 1px solid rgba(212, 168, 67, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 9999;
}

.taskbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.taskbar-center {
    display: flex;
    align-items: center;
    gap: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.taskbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: calc(0.78rem * var(--fs));
    color: var(--text-secondary);
}

.taskbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: calc(1.2rem * var(--fs));
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.taskbar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.taskbar-btn.active {
    background: rgba(212, 168, 67, 0.15);
    color: var(--accent);
}

.taskbar-btn.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 3px;
    background: var(--accent);
    border-radius: 3px;
}

.taskbar-dot {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 50%;
}

.taskbar-clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: calc(0.78rem * var(--fs));
    font-weight: 500;
    color: var(--text-secondary);
    text-align: right;
    line-height: 1.3;
    cursor: default;
}

.taskbar-start {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: calc(1.1rem * var(--fs));
}

.taskbar-start:hover {
    background: rgba(212, 168, 67, 0.15);
}

/* --- START-MENÜ: Popup mit App-Grid und Suche --- */
.start-menu {
    position: fixed;
    bottom: calc(var(--taskbar-h) + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    width: 560px;
    max-height: 520px;
    background: rgba(19, 19, 24, 0.95);
    border: 1px solid rgba(212, 168, 67, 0.12);
    border-radius: 16px;
    padding: 20px;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 1px rgba(212, 168, 67, 0.15);
}



.start-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scale(1);
}

.start-search {
    width: 100%;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 168, 67, 0.12);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: calc(0.9rem * var(--fs));
    outline: none;
    margin-bottom: 18px;
    transition: border-color 0.2s;
}

.start-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(212, 168, 67, 0.1);
}

.start-section-label {
    font-size: calc(0.68rem * var(--fs));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding-left: 4px;
}

.start-apps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

.start-app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-primary);
}

.start-app-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.start-app-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(1.4rem * var(--fs));
    background: var(--glass);
    border: 1px solid var(--glass-border);
}

.start-app-label {
    font-size: calc(0.72rem * var(--fs));
    font-weight: 500;
    text-align: center;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.start-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.start-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.start-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: calc(0.85rem * var(--fs));
    color: #fff;
}

.start-user-name {
    font-size: calc(0.82rem * var(--fs));
    font-weight: 600;
}

.start-user-role {
    font-size: calc(0.68rem * var(--fs));
    color: var(--text-secondary);
}

.start-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 77, 77, 0.08);
    border: 1px solid rgba(255, 77, 77, 0.15);
    color: var(--danger);
    font-size: calc(0.78rem * var(--fs));
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.start-logout:hover {
    background: rgba(255, 77, 77, 0.15);
    border-color: rgba(255, 77, 77, 0.3);
}

/* --- DESKTOP-ICONS: App-Icons auf dem Desktop --- */
.os-desktop-icons {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 8px;
    max-height: calc(100vh - var(--taskbar-h) - 40px);
    z-index: 1;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 82px;
    padding: 12px 6px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-primary);
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.06);
}

.desktop-icon:active {
    background: rgba(212, 168, 67, 0.12);
}

.desktop-icon-img {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(1.6rem * var(--fs));
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.desktop-icon:hover .desktop-icon-img {
    transform: scale(1.08);
}

.desktop-icon-label {
    font-size: calc(0.68rem * var(--fs));
    font-weight: 500;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
    max-width: 76px;
    word-wrap: break-word;
}

/* --- FENSTER-SYSTEM: Layer, Fenster, Titlebar --- */
.os-window-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--taskbar-h);
    z-index: 100;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
}

.os-window {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(13, 13, 18, 0.96);
    animation: windowOpen 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes windowOpen {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

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

.os-window-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 44px;
    min-height: 44px;
    background: rgba(19, 19, 24, 0.98); /* Dunkler als der Body */
    border-bottom: 1px solid var(--border);
    user-select: none;
}

.os-window-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: calc(0.82rem * var(--fs));
    font-weight: 600;
    color: var(--text-secondary);
}

.os-window-title-icon {
    font-size: calc(1rem * var(--fs));
}

.os-window-controls {
    display: flex;
    gap: 8px;
}

.os-win-ctrl {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    opacity: 0.7;
}

.os-win-ctrl:hover {
    opacity: 1;
    transform: scale(1.15);
}

.os-win-ctrl.minimize {
    background: #f59e0b;
}

.os-win-ctrl.maximize {
    background: #10b981;
}

.os-win-ctrl.close {
    background: #ef4444;
}

.os-window-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px;
    background: radial-gradient(ellipse at top left, rgba(19, 19, 24, 1), rgba(13, 13, 18, 1));
}

.os-window-sidebar {
    display: flex;
    height: calc(100% - 44px);
}

.os-sidebar {
    width: 240px;
    min-width: 240px;
    background: rgba(13, 13, 18, 0.95);
    border-right: 1px solid rgba(212, 168, 67, 0.08);
    display: flex;
    flex-direction: column;
    padding: 16px 10px;
    overflow-y: auto;
}

.os-sidebar-section {
    margin-bottom: 16px;
}

.os-sidebar-label {
    font-size: calc(0.6rem * var(--fs));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    padding: 0 10px;
    margin-bottom: 6px;
}

.os-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: calc(0.85rem * var(--fs));
    font-weight: 500;
    transition: all 0.15s;
    margin-bottom: 2px;
}

.os-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.os-sidebar-link.active {
    background: rgba(212, 168, 67, 0.10);
    color: var(--accent);
}

.os-sidebar-logout {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--danger);
    text-decoration: none;
    font-size: calc(0.85rem * var(--fs));
    font-weight: 500;
    transition: all 0.15s;
}

.os-sidebar-logout:hover {
    background: rgba(255, 77, 77, 0.08);
}

.os-main-area {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    font-size: calc(0.6rem * var(--fs));
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid rgba(12, 12, 16, 0.9);
    animation: pulse-notif 2s infinite;
}

@keyframes pulse-notif {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* --- BENACHRICHTIGUNGS-DROPDOWN --- */
.notif-dropdown {
    position: fixed;
    bottom: calc(var(--taskbar-h) + 10px);
    right: 16px;
    width: 340px;
    max-height: 400px;
    background: rgba(19, 19, 24, 0.95);
    border: 1px solid rgba(212, 168, 67, 0.12);
    border-radius: 14px;
    z-index: 10001;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: none;
    overflow: hidden;
}

.notif-dropdown.open {
    display: block;
}

.notif-header {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: calc(0.82rem * var(--fs));
    font-weight: 700;
    color: var(--accent);
}

.notif-list {
    max-height: 300px;
    overflow-y: auto;
}

.notif-item {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s;
    cursor: pointer;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notif-item.unread {
    border-left: 3px solid var(--accent);
    background: rgba(212, 168, 67, 0.03);
}

.notif-title {
    font-size: calc(0.78rem * var(--fs));
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 2px;
}

.notif-msg {
    font-size: calc(0.72rem * var(--fs));
    color: var(--text-secondary);
}

.notif-time {
    font-size: calc(0.65rem * var(--fs));
    color: rgba(255, 255, 255, 0.2);
    margin-top: 4px;
}

.notif-footer {
    padding: 10px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.notif-footer a {
    color: var(--accent);
    text-decoration: none;
    font-size: calc(0.72rem * var(--fs));
    font-weight: 600;
}

/* --- KARTEN & UI-ELEMENTE --- */
.card {
    background: var(--card-bg);
    padding: 28px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: calc(0.72rem * var(--fs));
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* --- 12. FORMULARE (Zentral) --- */
input,
textarea,
select {
    width: 100%;
    background: rgba(10, 10, 14, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px 15px;
    color: white;
    font-size: calc(0.92rem * var(--fs));
    font-family: 'Outfit', sans-serif;
    margin-bottom: 16px;
    transition: all 0.2s;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);

    /* Dropdown-Spezifisch */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%237a7568%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 14px top 50%;
    background-size: 10px auto;
    padding-right: 40px;
}

/* Fix für die Dropdown-Liste selbst */
select option {
    background: #131318;
    color: #e8e4dc;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.record-row td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    font-size: calc(0.88rem * var(--fs));
}

.record-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* --- BADGES: Farbige Status-Labels --- */
.badge {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: calc(0.7rem * var(--fs));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.badge.person {
    background: rgba(212, 168, 67, 0.15);
    color: #e8d5a0;
    border-color: rgba(212, 168, 67, 0.2);
}

.badge.company {
    background: rgba(39, 174, 96, 0.15);
    color: #74d69d;
    border-color: rgba(39, 174, 96, 0.2);
}

.badge.group {
    background: rgba(255, 77, 77, 0.15);
    color: #ff8080;
    border-color: rgba(255, 77, 77, 0.2);
}

.btn-submit,
.btn-cancel {
    background: rgba(255, 255, 255, 0.03);
    color: #c0c0c0;
    border: 1px solid rgba(192, 192, 192, 0.2);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: calc(0.82rem * var(--fs));
    font-family: 'Outfit', sans-serif;
}

.btn-submit:hover {
    background: rgba(39, 174, 96, 0.15);
    color: #ffffff;
    border-color: var(--success);
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.2);
}

.btn-cancel:hover {
    background: rgba(255, 77, 77, 0.15);
    color: #ffffff;
    border-color: var(--danger);
    box-shadow: 0 0 20px rgba(255, 77, 77, 0.2);
}

.btn-create {
    background: rgba(255, 255, 255, 0.03);
    color: #c0c0c0;
    border: 1px solid rgba(192, 192, 192, 0.2);
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: calc(0.75rem * var(--fs));
    font-family: 'Outfit', sans-serif;
}

.btn-person:hover {
    background: rgba(212, 168, 67, 0.15);
    border-color: #d4a843;
    box-shadow: 0 0 12px rgba(212, 168, 67, 0.2);
    color: #fff;
}

.btn-company:hover {
    background: rgba(40, 167, 69, 0.15);
    border-color: #28a745;
    box-shadow: 0 0 12px rgba(40, 167, 69, 0.2);
    color: #fff;
}

.btn-group:hover {
    background: rgba(220, 53, 69, 0.15);
    border-color: #dc3545;
    box-shadow: 0 0 12px rgba(220, 53, 69, 0.2);
    color: #fff;
}

.btn-action {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    text-transform: uppercase;
    font-size: calc(0.82rem * var(--fs));
    font-family: 'Outfit', sans-serif;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

#globalSearch {
    width: 100%;
    padding: 14px 20px;
    background: rgba(10, 10, 14, 0.6);
    border: 1px solid var(--border);
    color: white;
    border-radius: 10px;
    font-size: calc(0.95rem * var(--fs));
    font-family: 'Outfit', sans-serif;
}

#globalSearch:focus {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.tabs-nav {
    display: flex;
    margin-bottom: -1px;
    z-index: 10;
}

.tab-item {
    display: flex;
    align-items: center;
    background: rgba(20, 20, 24, 0.8);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.tab-item.active {
    background: var(--card-bg);
    border-bottom: 2px solid var(--card-bg);
}

.tab-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: calc(0.82rem * var(--fs));
    font-weight: 600;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
}

.tab-item.active .tab-link {
    color: var(--accent);
}

.close-tab {
    color: #555;
    font-size: calc(1rem * var(--fs));
    transition: color 0.2s;
}

.close-tab:hover {
    color: var(--danger);
}

.strafrechner-wrapper {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    height: calc(100vh - 44px - var(--taskbar-h)) !important;
    overflow: hidden !important;
}

.law-sidebar {
    width: 340px !important;
    min-width: 340px !important;
    max-width: 340px !important;
    background: rgba(14, 14, 18, 0.98) !important;
    border-right: 1px solid var(--border) !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    flex-shrink: 0 !important;
}

#accordion-laws {
    flex: 1 !important;
    overflow-y: auto !important;
}

.calculator-main {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
}

#tab-container {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 30px !important;
}

.accordion-body {
    display: none;
    background: rgba(0, 0, 0, 0.2);
}

.tab-pane {
    max-width: 1000px;
    margin: 0 auto;
}

.accordion-header {
    width: 100%;
    padding: 14px 18px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: calc(0.72rem * var(--fs));
    font-family: 'Outfit', sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.accordion-header:hover {
    background: rgba(212, 168, 67, 0.06);
    color: var(--accent);
}

.sidebar-header {
    padding: 18px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border);
}

.sidebar-header h3 {
    margin: 0;
    font-size: calc(0.85rem * var(--fs));
    letter-spacing: 2px;
    color: var(--accent);
}

.buch-tag {
    font-size: calc(0.65rem * var(--fs));
    background: var(--accent);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.law-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 6px 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.law-card:hover {
    background: rgba(212, 168, 67, 0.04);
    border-color: rgba(212, 168, 67, 0.2);
    transform: translateX(4px);
}

.law-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.law-buch {
    color: var(--accent);
    font-weight: 700;
    font-size: calc(0.72rem * var(--fs));
}

.law-title {
    flex-grow: 1;
    font-weight: 600;
    font-size: calc(0.82rem * var(--fs));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.law-code-badge {
    background: var(--accent);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: calc(0.7rem * var(--fs));
    font-weight: 700;
}

.law-absatz {
    font-size: calc(0.72rem * var(--fs));
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.law-zusatz {
    font-size: calc(0.78rem * var(--fs));
    color: #bbb;
    margin-bottom: 8px;
    line-height: 1.3;
}

.law-stats {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-top: 1px solid var(--border);
    padding-top: 6px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    font-size: calc(0.72rem * var(--fs));
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 700;
    color: var(--success);
}

.law-card-subline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0;
}

.law-verjaehrung {
    font-size: calc(0.68rem * var(--fs));
    color: var(--text-secondary);
    font-style: italic;
}

.border-ordnungswiedrigkeit {
    border-left: 6px solid rgba(255, 255, 255, 0.5) !important;
}

.border-vergehen {
    border-left: 6px solid rgba(40, 167, 69, 0.5) !important;
}

.border-verbrechen {
    border-left: 6px solid rgba(255, 193, 7, 0.5) !important;
}

.border-schwerverbrechen {
    border-left: 6px solid rgba(220, 53, 69, 0.5) !important;
}

.badge-typ {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: calc(0.68rem * var(--fs));
    font-weight: 700;
    text-transform: uppercase;
}

.typ-ordnungswiedrigkeit {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.typ-vergehen {
    background: rgba(40, 167, 69, 0.12);
    color: #2ecc71;
    border: 1px solid rgba(40, 167, 69, 0.15);
}

.typ-verbrechen {
    background: rgba(255, 193, 7, 0.12);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.15);
}

.typ-schwerverbrechen {
    background: rgba(220, 53, 69, 0.12);
    color: #e74c3c;
    border: 1px solid rgba(220, 53, 69, 0.15);
}

.codes-summary-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 6px;
    min-height: 40px;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.summary-badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: calc(0.78rem * var(--fs));
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.final-calculation-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

.calc-box {
    background: rgba(255, 255, 255, 0.02);
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.calc-row {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
}

.check-container input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    box-shadow: none !important;
}

.check-container input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow) !important;
}

.check-container input[type="checkbox"]:checked::after {
    content: '✔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: var(--fs-12);
}

.time-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.time-label {
    color: var(--text-secondary);
    font-size: calc(0.82rem * var(--fs));
    text-transform: uppercase;
}

.time-value {
    color: #ffc107;
    font-weight: 700;
    font-size: calc(1rem * var(--fs));
}

.name-container {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.name-container .input-group {
    flex: 1;
}

.input-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    width: 100% !important;
    margin-bottom: 12px;
    align-items: center;
}

.input-row .input-field {
    flex: 1 !important;
    margin-bottom: 0 !important;
}

.permission-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.matrix-container,
.matrix-wrapper {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    background: rgba(8, 8, 12, 0.6);
}

.permission-table th:first-child,
.permission-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    background: rgba(16, 16, 20, 0.98);
    border-right: 2px solid var(--accent);
    min-width: 260px;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
}

.permission-table thead th {
    position: sticky;
    top: 0;
    z-index: 11;
    background: rgba(18, 18, 22, 0.98);
}

.permission-table thead th:first-child {
    z-index: 20;
}

.permission-table th,
.permission-table td {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    color: #eee;
    white-space: nowrap;
}

.permission-table th {
    color: var(--accent);
    font-size: calc(0.75rem * var(--fs));
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-row td {
    background: rgba(255, 255, 255, 0.03) !important;
    font-weight: 700;
    color: var(--accent) !important;
    z-index: 15 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.perm-row:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.perm-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: rgba(10, 10, 14, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    margin: 0;
}

.perm-checkbox:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.perm-checkbox:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: var(--fs-11);
    font-weight: 700;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
}

mark {
    background: var(--accent);
    color: black;
    border-radius: 2px;
}

.law-item {
    transition: all 0.2s;
    padding: 8px;
    border-radius: 4px;
}

.law-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.folder-dropzone.dragover {
    background: rgba(255, 159, 67, 0.12) !important;
    border: 1px dashed var(--accent) !important;
}

.draggable-link:active {
    cursor: grabbing;
    opacity: 0.5;
}

.nav-sub-link {
    padding-left: 30px !important;
    font-size: calc(0.82rem * var(--fs)) !important;
    opacity: 0.8;
    border-left: 2px solid var(--accent);
    margin-left: 8px;
}

.nav-sub-link:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.04);
}

.nav-section-label {
    margin-top: 16px;
    padding: 0 12px;
    color: var(--accent);
    text-transform: uppercase;
    font-size: calc(0.6rem * var(--fs));
    font-weight: 700;
    letter-spacing: 1.5px;
}

.sidebar {
    display: none;
}

.main-content {
    padding: 0;
    flex-grow: 1;
    overflow: visible;
    background: transparent;
}

.badge-profile-container {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn-remove-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    text-decoration: none;
    font-size: var(--fs-10);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-remove-badge:hover {
    background: var(--danger);
}

/* --- APP-VERWALTUNG: Toggle-Grid --- */
.app-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.app-user-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 20px;
    transition: all 0.2s;
}

.app-user-card:hover {
    border-color: rgba(212, 168, 67, 0.2);
    background: rgba(255, 255, 255, 0.03);
}

.app-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.app-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: calc(0.9rem * var(--fs));
    color: #fff;
}

.app-user-info h4 {
    margin: 0;
    font-size: calc(0.92rem * var(--fs));
    font-weight: 600;
}

.app-user-role {
    font-size: calc(0.7rem * var(--fs));
    color: var(--text-secondary);
}

.app-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.01);
    transition: background 0.15s;
}

.app-toggle-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.app-toggle-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: calc(0.82rem * var(--fs));
}

.app-toggle-icon {
    font-size: calc(1rem * var(--fs));
}

/* --- TOGGLE-SWITCHES: An/Aus Schalter --- */
.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
}

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

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: all 0.3s;
}

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

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

.profile-container {
    max-width: 1300px;
    margin: 0 auto;
}

/* --- LOGIN/REGISTRIERUNG: OS-Sperrbildschirm --- */
.auth-lockscreen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 30% 20%, rgba(212, 168, 67, 0.04) 0%, #0d0d12 60%);
    z-index: 99999;
}

.auth-lockscreen::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 900px 700px at 30% 40%, rgba(212, 168, 67, 0.06), transparent),
        radial-gradient(ellipse 600px 500px at 70% 60%, rgba(180, 140, 50, 0.04), transparent);
    pointer-events: none;
}

.auth-lockscreen-time {
    font-family: 'Outfit', sans-serif;
    font-size: calc(5rem * var(--fs));
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: -4px;
    margin-bottom: 4px;
    z-index: 1;
}

.auth-lockscreen-date {
    font-size: calc(1.1rem * var(--fs));
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 50px;
    z-index: 1;
    font-weight: 400;
}

.auth-card-os {
    width: 100%;
    max-width: 380px;
    padding: 36px;
    background: rgba(19, 19, 24, 0.7);
    border: 1px solid rgba(212, 168, 67, 0.12);
    border-radius: 20px;
    z-index: 1;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.auth-card-os h1 {
    text-align: center;
    font-size: calc(1.3rem * var(--fs));
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.auth-card-os .auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: calc(0.82rem * var(--fs));
    margin-bottom: 28px;
}

.auth-input-os {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: white;
    font-size: calc(0.92rem * var(--fs));
    font-family: 'Outfit', sans-serif;
    margin-bottom: 12px;
    transition: all 0.2s;
    box-shadow: none;
}

.auth-input-os:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    background: rgba(255, 255, 255, 0.06);
}

.auth-btn-os {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    border: none;
    color: #0d0d12;
    font-weight: 700;
    font-size: calc(0.88rem * var(--fs));
    border-radius: 12px;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.3s;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
}

.auth-btn-os:hover {
    filter: brightness(1.15);
    box-shadow: 0 8px 30px rgba(212, 168, 67, 0.3);
    transform: translateY(-1px);
}

.auth-error {
    background: rgba(255, 77, 77, 0.08);
    color: #ff6b6b;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: calc(0.82rem * var(--fs));
    margin-bottom: 16px;
    text-align: center;
    border: 1px solid rgba(255, 77, 77, 0.15);
}

.auth-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.auth-link:hover {
    opacity: 0.8;
}

/* ============================================================
 *  PREVIEW-MATCHING COMPONENTS
 *  Repliziert das React-Preview Design fuer PHP-Seiten
 * ============================================================ */

/* --- StatCard --- */
.p-stat {
    background: #131318;
    border: 1px solid rgba(212, 168, 67, 0.12);
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center
}

.p-stat-icon {
    font-size: var(--fs-18);
    margin-bottom: 2px
}

.p-stat-label {
    font-size: var(--fs-9);
    color: #7a7568;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 2px
}

.p-stat-value {
    font-size: var(--fs-16);
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Fira Code', monospace
}

/* --- Section Card --- */
.p-sec {
    background: #131318;
    border: 1px solid rgba(212, 168, 67, 0.12);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden
}

.p-sec-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px 0
}

.p-sec-title {
    font-size: var(--fs-13);
    font-weight: 700;
    color: #e8e4dc
}

.p-sec-body {
    padding: 10px 14px 14px
}

/* --- Badge --- */
.p-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 6px;
    font-size: var(--fs-10);
    font-weight: 700;
    letter-spacing: .5px
}

/* --- Button --- */
.p-btn {
    padding: 4px 12px;
    border-radius: 8px;
    font-size: var(--fs-11);
    font-weight: 700;
    cursor: pointer;
    font-family: 'Segoe UI', system-ui, sans-serif;
    transition: opacity .12s
}

.p-btn:hover {
    opacity: .85
}

.p-btn-full {
    width: 100%;
    text-align: center;
    padding: 8px 18px;
    font-size: var(--fs-12)
}

/* --- Table --- */
.p-table {
    width: 100%;
    border-collapse: collapse
}

.p-th {
    padding: 7px 5px;
    font-size: var(--fs-9);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7a7568;
    text-align: left;
    border-bottom: 1px solid rgba(212, 168, 67, 0.12)
}

.p-td {
    padding: 7px 5px;
    font-size: var(--fs-11);
    color: #e8e4dc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03)
}

.p-tr:hover {
    background: rgba(255, 255, 255, 0.02)
}

/* --- Inputs (Preview Style) --- */
.p-input {
    width: 100%;
    padding: 7px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 168, 67, 0.12);
    border-radius: 7px;
    color: #e8e4dc;
    font-size: var(--fs-11);
    outline: none;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif
}

.p-input:focus, 
input:focus, 
textarea:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 15px var(--accent-glow) !important;
}

.p-input-label {
    font-size: var(--fs-9);
    color: #7a7568;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 2px;
    display: block
}

/* --- Avatar Circle --- */
.p-avatar {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0
}

/* --- Flatrate Progress --- */
.p-progress {
    height: 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden
}

.p-progress-bar {
    height: 100%;
    border-radius: 5px
}

/* --- Mono text --- */
.p-mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace
}

/* --- Color bar left --- */
.p-color-bar {
    width: 3px;
    border-radius: 3px;
    flex-shrink: 0
}

/* --- Tab pills --- */
.p-tab {
    padding: 6px 14px;
    border-radius: 7px;
    font-size: var(--fs-11);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .12s;
    background: transparent;
    color: #7a7568
}

.p-tab.active {
    font-weight: 700;
    background: rgba(212, 168, 67, 0.12);
    color: #d4a843;
    border-color: rgba(212, 168, 67, 0.25)
}

/* --- Checkbox (Strafrechner) --- */
.p-check {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid #7a7568;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-10);
    font-weight: 700;
    flex-shrink: 0
}

.p-check.checked {
    border-color: #d4a843;
    background: #d4a843;
    color: #0d0d12
}

/* --- Desktop icons (Dashboard) --- */
.os-desktop-icons {
    position: absolute;
    inset: 0;
    bottom: 46px;
    z-index: 2;
    pointer-events: none
}

.desktop-icon {
    position: absolute;
    width: 76px;
    text-align: center;
    padding: 8px 3px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s, box-shadow .12s;
    pointer-events: auto;
    user-select: none
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.04)
}

.desktop-icon.dragging {
    z-index: 999;
    opacity: 0.8;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4)
}

.desktop-icon.selected {
    background: rgba(212, 168, 67, 0.08);
    box-shadow: 0 0 0 1px rgba(212, 168, 67, 0.2)
}

.desktop-icon-img {
    width: 38px;
    height: 38px;
    margin: 0 auto 3px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-18);
    border: 1px solid
}

.desktop-icon-label {
    font-size: var(--fs-9);
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    line-height: 1.2
}

/* --- Calendar Grid --- */
.p-cal-day {
    min-height: 46px;
    padding: 3px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid transparent;
    cursor: pointer
}

.p-cal-day.today {
    background: rgba(212, 168, 67, 0.08);
    border-color: rgba(212, 168, 67, 0.25)
}

.p-cal-day:hover {
    background: rgba(255, 255, 255, 0.03)
}

.p-cal-event {
    font-size: var(--fs-7);
    padding: 1px 3px;
    border-radius: 3px;
    margin-bottom: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600
}

/* --- Strafrechner Sidebar (Preview) --- */
.p-straf-sidebar {
    width: 190px;
    border-right: 1px solid rgba(212, 168, 67, 0.12);
    padding: 8px;
    flex-shrink: 0;
    overflow: auto
}

.p-straf-book {
    padding: 7px 8px;
    border-radius: 7px;
    margin-bottom: 2px;
    cursor: pointer;
    font-size: var(--fs-11);
    border: 1px solid transparent;
    transition: all .12s
}

.p-straf-book.active {
    background: rgba(212, 168, 67, 0.12);
    color: #d4a843;
    font-weight: 700;
    border-color: rgba(212, 168, 67, 0.25)
}

.p-straf-law {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(212, 168, 67, 0.12);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all .12s
}

.p-straf-law.selected {
    background: rgba(212, 168, 67, 0.08);
    border-color: rgba(212, 168, 67, 0.3)
}

.p-straf-law:hover {
    background: rgba(255, 255, 255, 0.03)
}

/* --- Notification slide-in --- */
.p-notif {
    border-radius: 10px;
    padding: 8px 12px;
    font-size: var(--fs-11);
    animation: slideIn .3s ease-out;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    margin-bottom: 4px
}

/* --- Template card --- */
.p-tmpl {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(212, 168, 67, 0.12);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all .12s
}

.p-tmpl.selected {
    background: rgba(212, 168, 67, 0.08);
    border-color: rgba(212, 168, 67, 0.3)
}

.p-tmpl:hover {
    background: rgba(255, 255, 255, 0.03)
}

.p-toggle {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px
}

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

.p-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(212, 168, 67, 0.12);
    border-radius: 18px;
    transition: .2s
}

.p-toggle-slider::before {
    content: "";
    position: absolute;
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background: #7a7568;
    border-radius: 50%;
    transition: .2s
}

.p-toggle input:checked+.p-toggle-slider {
    background: rgba(212, 168, 67, 0.2);
    border-color: rgba(212, 168, 67, 0.4)
}

.p-toggle input:checked+.p-toggle-slider::before {
    transform: translateX(14px);
    background: #d4a843
}

/* Embed-Mode Overrides fuer alte Seitendesigns */
.embed-content .card,
.embed-content .profile-container .card {
    background: #131318 !important;
    border: 1px solid rgba(212, 168, 67, 0.12) !important;
    border-radius: 12px !important;
    padding: 14px !important;
    margin-bottom: 12px !important;
    box-shadow: none !important
}

.embed-content .card h2,
.embed-content .card h3,
.embed-content .card h4 {
    color: #e8e4dc !important;
    font-size: var(--fs-13) !important;
    font-weight: 700 !important;
    margin: 0 0 8px !important
}

.embed-content .profile-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important
}

.embed-content .breadcrumb-nav {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(212, 168, 67, 0.12) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: var(--fs-10) !important;
    margin-bottom: 10px !important
}

.embed-content .breadcrumb-nav a {
    color: #7a7568 !important;
    font-size: var(--fs-10) !important
}

.embed-content .breadcrumb-nav a:hover {
    color: #d4a843 !important
}

/* Styling für die Gruppen-Überschriften in Dropdowns */
select optgroup {
    background: #131318;
    /* Gleicher dunkler Hintergrund wie das Modal */
    color: var(--accent);
    /* Dein Gold/Braun Ton für die Titel */
    font-style: normal;
    font-weight: 700;
    text-transform: uppercase;
    font-size: var(--fs-9);
    letter-spacing: 1px;
}

/* Fix für Chrome/Safari: Verhindert, dass die Optionen die Farbe der Überschrift erben */
select option {
    color: #e8e4dc !important;
    /* Normaler Text für die eigentlichen Einträge */
    background: #131318;
}

/* Hover-Effekt für Optionen (funktioniert je nach Browser unterschiedlich) */
select option:hover,
select option:focus {
    background-color: var(--accent-glow) !important;
}

.embed-content input[type="text"],
.embed-content input[type="number"],
.embed-content input[type="email"],
.embed-content input[type="password"],
.embed-content input[type="date"],
.embed-content input[type="time"],
.embed-content select,
.embed-content textarea {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(212, 168, 67, 0.12) !important;
    border-radius: 7px !important;
    color: #e8e4dc !important;
    font-size: var(--fs-11) !important;
    padding: 7px 8px !important;
    outline: none !important;
    font-family: 'Segoe UI', system-ui, sans-serif !important;
    box-sizing: border-box !important;

    /* NEU HINZUFÜGEN: */
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%237a7568%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px top 50% !important;
    background-size: 8px auto !important;
    padding-right: 25px !important;
}

.embed-content input:focus,
.embed-content select:focus,
.embed-content textarea:focus {
    border-color: rgba(212, 168, 67, 0.3) !important
}

.embed-content label {
    font-size: var(--fs-9) !important;
    color: #7a7568 !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    letter-spacing: .5px !important
}

.embed-content .btn-create,
.embed-content .btn-submit,
.embed-content .btn-cancel,
.embed-content button[type="submit"]:not(.p-btn) {
    background: rgba(212, 168, 67, 0.12) !important;
    border: 1px solid rgba(212, 168, 67, 0.3) !important;
    color: #d4a843 !important;
    border-radius: 8px !important;
    font-size: var(--fs-11) !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    padding: 6px 14px !important;
    font-family: 'Segoe UI', system-ui, sans-serif !important
}

.embed-content .btn-cancel {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(212, 168, 67, 0.12) !important;
    color: #7a7568 !important
}

.embed-content table:not(.p-table):not(.mx-tbl) {
    width: 100% !important;
    border-collapse: collapse !important
}

.embed-content table:not(.p-table):not(.mx-tbl) th {
    padding: 7px 5px !important;
    font-size: var(--fs-9) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: #7a7568 !important;
    text-align: left !important;
    border-bottom: 1px solid rgba(212, 168, 67, 0.12) !important;
    background: transparent !important
}

.embed-content table:not(.p-table):not(.mx-tbl) td {
    padding: 7px 5px !important;
    font-size: var(--fs-11) !important;
    color: #e8e4dc !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important
}

.embed-content table:not(.p-table):not(.mx-tbl) tr:hover td {
    background: rgba(255, 255, 255, 0.02) !important
}

.embed-content .badge,
.embed-content .badge-success,
.embed-content .badge-danger {
    display: inline-block !important;
    padding: 2px 9px !important;
    border-radius: 6px !important;
    font-size: var(--fs-10) !important;
    font-weight: 700 !important;
    letter-spacing: .5px !important
}

.embed-content .badge-success {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important
}

.embed-content .badge-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important
}

.embed-content .display-value {
    padding: 7px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 168, 67, 0.08);
    border-radius: 7px;
    color: #e8e4dc;
    font-size: var(--fs-11)
}

.embed-content hr {
    border: 0 !important;
    border-top: 1px solid rgba(212, 168, 67, 0.12) !important;
    margin: 12px 0 !important
}

.embed-content p {
    color: #7a7568 !important;
    font-size: var(--fs-11) !important
}

.embed-content a:not(.p-btn) {
    color: #d4a843 !important
}

.embed-content .input-field {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(212, 168, 67, 0.12) !important;
    border-radius: 7px !important;
    color: #e8e4dc !important;
    font-size: var(--fs-11) !important;
    padding: 7px 8px !important
}

.embed-content .app-manager-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 10px !important
}

.embed-content .app-user-card {
    background: rgba(255, 255, 255, 0.015) !important;
    border: 1px solid rgba(212, 168, 67, 0.12) !important;
    border-radius: 10px !important;
    padding: 12px !important
}

.embed-content .check-container {
    font-size: var(--fs-10) !important;
    color: #7a7568 !important
}

.embed-content-straf .card {
    background: #131318 !important;
    border: 1px solid rgba(212, 168, 67, 0.12) !important;
    border-radius: 12px !important;
    padding: 14px !important
}

.embed-content-straf input[type="text"],
.embed-content-straf input[type="number"],
.embed-content-straf select {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(212, 168, 67, 0.2) !important;
    border-radius: 7px !important;
    color: #e8e4dc !important; /* Hellgrau/Weiß für gute Lesbarkeit */
    font-size: var(--fs-11) !important;
    padding: 7px 8px !important;
    outline: none !important;
}

/* Fokus-Zustand für bessere Sichtbarkeit beim Tippen */
.embed-content-straf input:focus {
    border-color: var(--accent) !important;
    background: rgba(0, 0, 0, 0.5) !important;
}

/* --- MANDATS-SWITCH (PROFIL) --- */
.mandat-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

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

.mandat-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--danger); /* Rot wenn aus */
    transition: .4s;
    border-radius: 22px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.mandat-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.mandat-switch input:checked + .mandat-slider {
    background-color: var(--success); /* Grün wenn an */
}

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

/* Fix für das Dokumenten-Modal */
#placeholderModal .card {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#dynamicPlaceholders {
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin; /* Für Firefox */
}

/* Scrollbar-Design für den inneren Bereich */
#dynamicPlaceholders::-webkit-scrollbar {
    width: 4px;
}
#dynamicPlaceholders::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

/* Erzwungene Checkbox-Darstellung für die Vorlagen-Zuweisung */
#addForm input[type="checkbox"],
#editForm input[type="checkbox"],
.embed-content input[type="checkbox"] {
    appearance: checkbox !important;
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
    border: 1px solid #333 !important;
    cursor: pointer !important;
    position: relative !important;
}

/* Fix für die Label-Darstellung im Modal */
#addForm label, 
#editForm label {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-transform: none !important;
    cursor: pointer;
    margin-bottom: 0 !important;
}

/* Falls das Grid die Checkboxen noch staucht */
#addForm .p-input-label + div,
#editForm .p-input-label + div {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

/* Blinkender Warn-Effekt für kritische Fristen */
.dw-warn {
    color: #ef4444 !important; /* Kräftiges Rot */
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    animation: pulseWarn 2s infinite;
}

@keyframes pulseWarn {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}