/* --- Globales Setup & Theme --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
}

body {
    background-color: #030712;
    color: #f3f4f6;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.hidden { display: none !important; }
.font-bold { font-weight: bold; }
.text-gold { color: #d4af37 !important; }

/* --- 1. Login Screen --- */
.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: radial-gradient(circle at center, #05140e 0%, #030712 100%);
    padding: 20px;
    text-align: center;
}

.logo-area { margin-bottom: 20px; }

.sheriff-star {
    font-size: 80px;
    color: #10b981;
    filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.6));
    animation: pulse 3s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.4)); }
    100% { transform: scale(1.05); filter: drop-shadow(0 0 25px rgba(16, 185, 129, 0.8)); }
}

h1 {
    font-size: 2.5rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.divider {
    width: 150px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #10b981, transparent);
    margin-bottom: 25px;
}

.welcome-text {
    max-width: 500px;
    color: #9ca3af;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 35px;
}

.status-box {
    background-color: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 15px 40px;
    border-radius: 6px;
    min-width: 200px;
}

.status-box h3 {
    font-size: 0.9rem;
    color: #9ca3af;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.form-group { margin-bottom: 15px; }

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: #9ca3af;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.form-group input, .form-group select {
    width: 100%;
    background-color: #030712;
    border: 1px solid #374151;
    padding: 10px;
    border-radius: 4px;
    color: #ffffff;
    font-size: 0.9rem;
}

.form-group input:focus { border-color: #10b981; outline: none; }

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    padding: 14px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

/* --- 2. Desktop OS --- */
.desktop-container {
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #111827 0%, #030712 100%);
    position: relative;
    padding: 20px;
}

.desktop-icons {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 120px;
    position: absolute;
    left: 20px;
    top: 20px;
    z-index: 5;
}

.icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.icon:hover { background-color: rgba(255, 255, 255, 0.1); }
.icon-picture { font-size: 40px; margin-bottom: 8px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.icon-text { color: #ffffff; font-size: 0.85rem; font-weight: 500; text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8); }

/* --- 3. Windows & App Layouts --- */
.window {
    position: absolute;
    /* Geänderte Werte, damit Fenster standardmäßig schwebend starten */
    width: 1100px;
    height: 680px;
    max-width: 90vw;
    max-height: 82vh;
    background-color: #0b0f19;
    border: 1px solid #10b981;
    border-radius: 6px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10;
}

.window-header {
    background-color: #111827;
    border-bottom: 2px solid #10b981;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move; /* Zeigt dem Nutzer an, dass das Fenster verschiebbar ist */
}

.window-title, .window-title-left { 
    color: #ffffff; 
    font-size: 1rem; 
    font-weight: bold; 
    letter-spacing: 0.5px; 
}

.window-controls { margin-left: auto; display: flex; gap: 8px; }

.win-btn {
    background: #1f2937;
    border: none;
    color: #9ca3af;
    width: 32px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.win-btn:hover { background-color: #374151; color: white; }
.close-btn:hover { background-color: #ef4444 !important; }
.window-content { flex-grow: 1; overflow-y: auto; padding: 25px; padding-bottom: 60px; }
.app-dark-bg { background-color: #090d16; }

/* Spezial-Klasse für maximierte Vollbild-Fenster */
.window.maximized {
    top: 0px !important;
    left: 0px !important; 
    width: 100vw !important;
    height: calc(100vh - 45px) !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0px;
    border: none;
    z-index: 500 !important;
}
.window.maximized .window-header {
    cursor: default; /* Deaktiviert Drag-Cursor im Vollbild */
}

.app-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 25px;
    height: 100%;
    align-items: start;
}

.app-left-col { display: flex; flex-direction: column; gap: 20px; }
.app-right-col { height: 100%; display: flex; flex-direction: column; min-height: 0; }

.dashboard-welcome h2 { font-size: 1.6rem; color: #ffffff; margin-bottom: 5px; }
.dashboard-welcome p { color: #64748b; font-size: 0.9rem; line-height: 1.4; }

.app-form-box {
    background-color: #111827;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 20px;
}

.app-form-box h3 {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 15px;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 8px;
}

.btn-add-item {
    width: 100%;
    background-color: #d4af37;
    color: black;
    border: none;
    padding: 12px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 5px;
}

.btn-add-item:hover { background-color: #fbbf24; }

.btn-add-item.btn-accent-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white !important;
}
.btn-add-item.btn-accent-green:hover {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

.app-list-box {
    background-color: #111827;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.app-list-box h3 {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #1e293b;
}

/* --- 4. Tabellen Styling --- */
.table-responsive { overflow-y: auto; flex-grow: 1; }
.app-table { width: 100%; border-collapse: collapse; text-align: left; }

.app-table th {
    background-color: #030712;
    color: #9ca3af;
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 12px 15px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #1e293b;
    position: sticky;
    top: 0;
    z-index: 2;
}

.app-table td { padding: 14px 15px; border-bottom: 1px solid #1e293b; color: #e5e7eb; font-size: 0.9rem; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background-color: rgba(16, 185, 129, 0.05); }
.normal-row:hover { background-color: rgba(255, 255, 255, 0.02); }
.empty-table-text { text-align: center; color: #4b5563; padding: 40px !important; font-style: italic; }

.badge-notes { background-color: rgba(55, 65, 81, 0.5); border: 1px solid #4b5563; padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; color: #d1d5db; }
.badge-danger-level { background-color: rgba(239, 68, 68, 0.15); border: 1px solid #ef4444; color: #fca5a5; padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; }

.badge-success-green {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid #10b981 !important;
    color: #34d399 !important;
}

.btn-delete-item { background-color: rgba(239, 68, 68, 0.2); border: 1px solid #ef4444; color: #f87171; padding: 5px 10px; border-radius: 4px; font-size: 0.8rem; cursor: pointer; }
.btn-delete-item:hover { background-color: #ef4444; color: white; }

/* --- 5. Ausbildungsakademie Grid --- */
.edu-classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px;
}

.edu-class-card {
    background-color: #030712;
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: fit-content;
}

.edu-class-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid #1e293b; padding-bottom: 10px; }
.edu-enrollment-zone { display: flex; gap: 8px; }
.edu-enrollment-zone input { flex-grow: 1; background-color: #111827; border: 1px solid #374151; padding: 8px 12px; border-radius: 4px; color: white; font-size: 0.85rem; }
.edu-enrollment-zone input:focus { border-color: #10b981; outline: none; }

.btn-enroll { 
    background-color: #10b981;
    color: white; 
    border: none; 
    padding: 8px 14px; 
    font-size: 0.8rem; 
    font-weight: bold; 
    text-transform: uppercase; 
    border-radius: 4px; 
    cursor: pointer; 
}
.btn-enroll:hover { background-color: #059669; }

.edu-students-list { max-height: 200px; overflow-y: auto; background-color: rgba(17, 24, 39, 0.5); border-radius: 4px; border: 1px solid #1e293b; }
.style-condensed th, .style-condensed td { padding: 8px 10px !important; font-size: 0.85rem !important; }

.btn-pass {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #34d399;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: bold;
}
.btn-pass:hover { background-color: #10b981; color: black; }

/* --- 6. Foto Akten Modal --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 999999; }
.modal-content { background-color: #0b0f19; border: 1px solid #10b981; width: 900px; max-width: 95%; border-radius: 8px; box-shadow: 0 0 30px rgba(16, 185, 129, 0.2); overflow: hidden; }
.modal-header { background-color: #111827; padding: 15px 20px; border-bottom: 1px solid #1e293b; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { color: #10b981; font-size: 1.2rem; }
.modal-close-btn { background: transparent; border: none; color: #9ca3af; font-size: 1.2rem; cursor: pointer; }
.modal-close-btn:hover { color: #ef4444; }
.modal-body { padding: 25px; }

.photo-grid-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.photo-slots-left, .photo-slots-right { display: flex; flex-direction: column; gap: 20px; }
.photo-slot-split { background-color: #111827; border: 1px solid #1e293b; border-radius: 6px; padding: 15px; }
.slot-title { font-size: 0.85rem; color: #9ca3af; text-transform: uppercase; margin-bottom: 10px; font-weight: bold; letter-spacing: 0.5px; }
.image-box { width: 100%; height: 160px; background-color: #030712; border: 2px dashed #374151; border-radius: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 12px; }
.placeholder-icon { font-size: 40px; opacity: 0.2; }
.slot-preview-img { width: 100%; height: 100%; object-fit: contain; }
.slot-actions { display: flex; gap: 10px; }
.btn-slot-upload { flex-grow: 1; background-color: #374151; color: white; padding: 8px; text-align: center; font-size: 0.85rem; font-weight: bold; border-radius: 4px; cursor: pointer; }
.btn-slot-upload:hover { background-color: #4b5563; }
.btn-slot-delete { background-color: rgba(239, 68, 68, 0.1); border: 1px solid #ef4444; color: #f87171; padding: 8px 15px; font-size: 0.85rem; border-radius: 4px; cursor: pointer; }
.btn-slot-delete:hover { background-color: #ef4444; color: white; }

/* --- 7. Leitstelle (Streifeneinteilung) --- */
.leitstelle-bg { background-color: #05070f; }
.leitstelle-header-text { font-size: 1.6rem; font-weight: bold; color: #10b981; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.leitstelle-section-title { font-size: 1.1rem; font-weight: bold; color: #d4af37; margin: 15px 0 10px 0; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 5px; }

.units-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 15px; 
}

.unit-card { background-color: #111827; border: 1px solid #1e293b; border-radius: 6px; padding: 15px; display: flex; flex-direction: column; gap: 12px; }
.swat-card { border-left: 4px solid #ef4444; border-top: 1px solid rgba(239, 68, 68, 0.3); }
.air-card { border-left: 4px solid #3b82f6; border-top: 1px solid rgba(59, 130, 246, 0.3); }
.unit-header { font-size: 1.1rem; font-weight: bold; color: #ffffff; display: flex; justify-content: space-between; }
.unit-status { font-size: 0.85rem; color: #9ca3af; }
.active-service { color: #10b981 !important; font-weight: bold; }
.officer-slots { background-color: #030712; border-radius: 4px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.slot { font-size: 0.85rem; color: #4b5563; }
.slot-num { color: #10b981; font-weight: bold; margin-right: 5px; }
.filled-slot { color: #ffffff; font-weight: 500; }
.unit-actions .input-group { display: flex; gap: 5px; margin-bottom: 8px; }
.unit-actions input { flex-grow: 1; background-color: #030712; border: 1px solid #374151; padding: 6px; color: white; font-size: 0.8rem; border-radius: 4px; }
.unit-actions select { background-color: #030712; border: 1px solid #374151; color: white; font-size: 0.8rem; border-radius: 4px; }
.button-group { display: flex; gap: 5px; }
.btn-register, .btn-unregister { flex-grow: 1; padding: 6px; font-size: 0.8rem; font-weight: bold; border-radius: 4px; cursor: pointer; border: none; }
.btn-register { background-color: #374151; color: white; }
.btn-register:hover { background-color: #4b5563; }
.btn-unregister { background-color: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid #ef4444; }
.btn-unregister:hover { background-color: #ef4444; color: white; }

/* --- 8. Untere Leiste (Taskbar) --- */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 45px;
    background-color: #090d16;
    border-top: 1px solid #10b981;
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 99999;
}

.taskbar-icons { 
    display: flex; 
    gap: 10px; 
    flex-grow: 1; 
    align-items: center;
}

.taskbar-tab {
    background-color: #111827;
    border: 1px solid #1e293b;
    color: #9ca3af;
    padding: 6px 16px;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
}

.taskbar-tab:hover {
    background-color: #1f2937;
    color: #ffffff;
}

.active-tab {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
    border-color: #10b981 !important;
    font-weight: bold;
}

.taskbar-time { 
    color: #9ca3af; 
    font-size: 0.85rem; 
    font-weight: bold; 
    margin-left: auto; 
}

/* --- 9. Start-Button & Start-Menü Styles --- */
.btn-start {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 20px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transition: all 0.15s ease;
    height: 32px;
}

.btn-start:hover {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
    transform: translateY(-1px);
}

.start-menu {
    position: fixed;
    bottom: 50px; 
    left: 10px;
    width: 280px;
    background-color: #0b0f19;
    border: 1px solid #10b981;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    z-index: 999999; 
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.start-menu-header {
    background-color: #111827;
    border-bottom: 1px solid #1e293b;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    font-size: 1.8rem;
    background-color: #1f2937;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.start-menu-body {
    padding: 10px;
    background-color: #0b0f19;
}

.start-menu-item {
    width: 100%;
    background: transparent;
    border: none;
    color: #e5e7eb;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}

.start-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.logout-btn {
    border-top: 1px solid #1e293b;
    margin-top: 5px;
    padding-top: 12px;
    color: #f87171 !important;
}

.logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.1) !important;
}