* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.login-page,
.setup-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(ellipse at 50% 58%, rgba(143, 96, 70, 0.54), transparent 27%),
        radial-gradient(ellipse at 19% 18%, rgba(21, 36, 60, 0.96), transparent 36%),
        radial-gradient(ellipse at 84% 18%, rgba(12, 24, 44, 0.94), transparent 31%),
        linear-gradient(180deg, #091426 0%, #101f35 50%, #09111d 100%);
}

.login-page::before,
.setup-body::before {
    content: "";
    position: fixed;
    inset: -8%;
    z-index: -1;
    background:
        radial-gradient(circle at 50% 56%, rgba(165, 116, 90, 0.42), transparent 20%),
        radial-gradient(circle at 18% 22%, rgba(23, 39, 63, 0.8), transparent 20%),
        radial-gradient(circle at 84% 24%, rgba(19, 31, 52, 0.8), transparent 20%);
    filter: blur(54px);
}

.web-login {
    width: min(440px, calc(100vw - 40px));
    text-align: center;
}

.login-avatar {
    width: 154px;
    height: 154px;
    margin: 0 auto 28px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 35%, #fff 0 24px, transparent 25px),
        radial-gradient(ellipse at 50% 74%, #fff 0 49px, transparent 50px),
        rgba(255, 255, 255, 0.16);
    box-shadow:
        0 0 0 28px rgba(255, 255, 255, 0.08),
        0 18px 44px rgba(0, 0, 0, 0.18);
}

.web-login h1 {
    margin: 0 0 24px;
    font-size: 34px;
    font-weight: 700;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.36);
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form input {
    height: 50px;
    padding: 0 15px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 8px;
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.login-form input::placeholder {
    color: rgba(255, 255, 255, 0.66);
}

.login-form input:focus {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.13);
}

.login-button,
.primary-link {
    min-height: 52px;
    padding: 0 24px;
    display: inline-grid;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: 9px;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.login-button:hover,
.primary-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.setup-button {
    width: 100%;
}

.login-message,
.setup-message {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.18);
}

.login-message.error,
.setup-message.error {
    border-color: rgba(255, 124, 124, 0.55);
    color: #ffd4d4;
}

.setup-message.success {
    border-color: rgba(114, 226, 149, 0.55);
    color: #d7ffe3;
}

.setup-card {
    width: min(560px, calc(100vw - 40px));
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    text-align: center;
    background: rgba(9, 16, 27, 0.72);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
}

.setup-card > img {
    width: 105px;
    height: 105px;
    object-fit: contain;
}

.setup-card h1 {
    margin: 14px 0 8px;
}

.setup-card > p {
    color: rgba(255, 255, 255, 0.74);
    line-height: 1.55;
}

.setup-form {
    display: grid;
    gap: 13px;
    text-align: left;
}

.setup-form label {
    display: grid;
    gap: 6px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
}

.setup-form input {
    height: 46px;
    padding: 0 13px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 7px;
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

.setup-form button {
    min-height: 50px;
    margin-top: 4px;
    border: 0;
    border-radius: 7px;
    color: #201507;
    font-weight: 800;
    background: linear-gradient(180deg, #f5ce6d 0%, #d7a43a 100%);
}

.computer-page {
    height: 100vh;
    overflow: hidden;
    background: #08141d;
}

.computer-desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at top left, rgba(34, 96, 142, 0.28), transparent 34%),
        linear-gradient(135deg, rgba(7, 17, 28, 0.94), rgba(9, 18, 30, 0.96)),
        linear-gradient(135deg, #102536 0%, #09131d 100%);
}

.computer-desktop::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: url("kh-desktop-background.png") 53% 50% / auto 78% no-repeat;
    opacity: 0.26;
    filter: drop-shadow(0 18px 50px rgba(0, 0, 0, 0.42));
}

.computer-desktop > * {
    position: relative;
    z-index: 1;
}

.desktop-icons {
    position: absolute;
    left: 26px;
    top: 26px;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(2, 132px);
    gap: 12px 8px;
}

.desktop-app {
    min-height: 112px;
    padding: 9px 7px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 5px;
    color: #fff;
    background: transparent;
}

.desktop-app:hover,
.desktop-app.active {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.12);
}

.desktop-app img {
    width: 66px;
    height: 66px;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.44));
}

.desktop-app span {
    font-size: 13px;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.64);
}

.desktop-brand {
    position: absolute;
    right: 34px;
    top: 28px;
    z-index: 2;
    padding: 13px 17px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(5, 12, 19, 0.46);
    backdrop-filter: blur(13px);
}

.desktop-brand strong {
    font-size: 24px;
}

.desktop-brand span {
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
}

.program-window {
    position: absolute;
    left: 8vw;
    top: 5vh;
    z-index: 20;
    width: 84vw;
    height: 86vh;
    overflow: hidden;
    border: 1px solid rgba(5, 14, 20, 0.78);
    border-radius: 9px;
    background: #edf1f4;
    box-shadow:
        0 32px 100px rgba(0, 0, 0, 0.58),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.window-titlebar {
    height: 66px;
    padding-left: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    background: linear-gradient(90deg, #102436 0%, #173c52 62%, #102436 100%);
    user-select: none;
}

.chat-titlebar,
.personnel-titlebar {
    background: linear-gradient(90deg, #28190e 0%, #67431e 58%, #24160d 100%);
}

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

.window-identity img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.window-identity div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.window-identity strong {
    font-size: 17px;
}

.window-identity small {
    color: rgba(255, 255, 255, 0.65);
    font-size: 11px;
}

.window-close {
    width: 58px;
    align-self: stretch;
    border: 0;
    color: #fff;
    font-size: 29px;
    background: transparent;
}

.window-close:hover {
    background: #c93b3b;
}

.reports-layout {
    height: calc(100% - 66px);
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
}

.reports-sidebar {
    min-height: 0;
    padding: 14px;
    border-right: 1px solid #cbd4da;
    background: #e4e9ed;
}

.reports-sidebar > header,
.report-detail-head,
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.reports-sidebar > header {
    height: 48px;
    color: #293d4b;
}

.reports-sidebar > header button,
.chat-toolbar button,
.section-head button {
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid #b8c4cc;
    border-radius: 5px;
    color: #304a5c;
    background: #fff;
}

.reports-list {
    height: calc(100% - 48px);
    min-height: 0;
    overflow-y: auto;
}

.report-list-item {
    width: 100%;
    margin-bottom: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    border: 1px solid #c8d1d8;
    border-radius: 7px;
    color: #283d4a;
    text-align: left;
    background: #fff;
}

.report-list-item:hover {
    border-color: #7597aa;
    background: #f5fbff;
}

.report-list-item small {
    color: #71808a;
}

.report-list-item span {
    color: #8b969d;
    font-size: 10px;
}

.report-detail {
    min-width: 0;
    min-height: 0;
    background: #f5f7f9;
}

.report-detail-head {
    height: 70px;
    padding: 0 18px;
    border-bottom: 1px solid #d4dce2;
    background: #fff;
}

.report-detail-head > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.report-detail-head strong {
    color: #263a47;
    font-size: 18px;
}

.report-detail-head small {
    overflow: hidden;
    color: #7d8a93;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-detail-content {
    height: calc(100% - 70px);
    min-height: 0;
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 13px;
    overflow-y: auto;
}

.report-section {
    min-width: 0;
    padding: 15px;
    border: 1px solid #d2dbe1;
    border-radius: 8px;
    background: #fff;
}

.report-section > strong {
    display: block;
    margin-bottom: 8px;
    color: #294252;
}

.report-section pre {
    margin: 0;
    color: #526570;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.danger-button {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #a43131;
    border-radius: 5px;
    color: #fff;
    background: #bd3b3b;
}

.danger-button.confirm {
    background: #831f1f;
}

.chat-window {
    left: 12vw;
    top: 8vh;
    width: 76vw;
    height: 80vh;
    background: #172028;
}

.chat-toolbar {
    height: 70px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #263b49;
    background: #f5f7f9;
}

.chat-toolbar > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-toolbar small {
    color: #7b8992;
}

.chat-messages {
    height: calc(100% - 218px);
    padding: 18px;
    overflow-y: auto;
    background:
        radial-gradient(circle at 84% 9%, rgba(207, 150, 61, 0.08), transparent 22%),
        linear-gradient(180deg, #202b34 0%, #151d24 100%);
}

.chat-message {
    margin-bottom: 11px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 7px;
    color: #eef2f5;
    background: rgba(255, 255, 255, 0.045);
}

.chat-message header {
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.chat-message header strong,
.chat-message p b {
    color: #f1bd55;
}

.chat-message header small {
    color: #8f9ba4;
}

.chat-message p {
    margin: 0;
    line-height: 1.48;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-composer {
    height: 82px;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 80px 110px;
    align-items: center;
    gap: 10px;
    background: #edf1f4;
}

.chat-composer textarea {
    height: 54px;
    padding: 10px 12px;
    resize: none;
    border: 1px solid #bac6ce;
    border-radius: 6px;
    color: #283c4b;
    outline: none;
    background: #fff;
}

.chat-composer span {
    color: #667681;
    font-size: 11px;
    text-align: center;
}

.chat-composer button,
.employee-action,
.search-form button {
    min-height: 44px;
    border: 1px solid #9b691d;
    border-radius: 6px;
    color: #1f1507;
    font-weight: 800;
    background: linear-gradient(180deg, #f6cd68 0%, #d8a13a 100%);
}

.personnel-window {
    left: 7vw;
    top: 4vh;
    width: 86vw;
    height: 88vh;
}

.personnel-layout {
    height: calc(100% - 66px);
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
}

.personnel-nav {
    padding: 16px 12px;
    border-right: 1px solid #cbd4db;
    background: #e2e8ec;
}

.personnel-nav button {
    width: 100%;
    min-height: 52px;
    margin-bottom: 7px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #304553;
    text-align: left;
    background: transparent;
}

.personnel-nav button:hover,
.personnel-nav button.active {
    border-color: #bdc8d0;
    background: #fff;
}

.personnel-nav button.active {
    box-shadow: inset 4px 0 0 #b78127;
}

.personnel-nav button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.personnel-nav .danger-nav {
    color: #9c3030;
}

.personnel-content {
    min-width: 0;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: #f4f6f8;
}

.personnel-tab {
    display: none;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
}

.personnel-tab.active {
    display: block;
}

.access-denied {
    position: absolute;
    inset: 20px;
    z-index: 10;
    padding: 25px;
    border: 1px solid #d79999;
    border-radius: 9px;
    color: #7e2828;
    background: #fff0f0;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.stat-grid article {
    min-height: 168px;
    padding: 21px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    border: 1px solid #d2dae0;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(28, 51, 66, 0.07);
}

.stat-grid span {
    color: #6f7e88;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.stat-grid strong {
    color: #9b681b;
    font-size: 47px;
}

.stat-grid .role-value {
    font-size: 27px;
    text-transform: capitalize;
}

.stat-grid small {
    color: #87949d;
}

.section-head {
    min-height: 68px;
    margin-bottom: 13px;
    padding: 12px 15px;
    border: 1px solid #d3dbe1;
    border-radius: 8px;
    color: #263a47;
    background: #fff;
}

.section-head > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-head small {
    color: #798791;
}

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

.employee-row {
    min-height: 74px;
    padding: 11px 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px auto;
    align-items: center;
    gap: 14px;
    border: 1px solid #d2dae0;
    border-radius: 8px;
    background: #fff;
}

.employee-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.employee-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(180deg, #bc8934 0%, #7f5318 100%);
}

.employee-main > div,
.employee-grade {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.employee-main strong,
.employee-grade strong {
    overflow: hidden;
    color: #293e4b;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-main small,
.employee-grade small {
    overflow: hidden;
    color: #7c8992;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-action {
    min-width: 115px;
    padding: 0 12px;
}

.employee-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.search-form {
    margin-bottom: 13px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px;
    gap: 10px;
}

.search-form input {
    height: 44px;
    padding: 0 13px;
    border: 1px solid #bdc8d0;
    border-radius: 6px;
    color: #283d4a;
    outline: none;
    background: #fff;
}

.settings-window {
    left: calc(50% - 250px);
    top: calc(50% - 260px);
    width: 500px;
    height: 520px;
}

.settings-content {
    height: calc(100% - 66px);
    padding: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #293f4d;
    background: #f4f6f8;
}

.settings-content > img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.settings-content h2 {
    margin: 13px 0 4px;
}

.settings-content p {
    margin: 5px 0;
    color: #667681;
}

.logout-button {
    min-height: 44px;
    margin-top: 24px;
    padding: 0 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
    background: #b63b3b;
}

.empty-state {
    min-height: 130px;
    display: grid;
    place-items: center;
    padding: 20px;
    color: #7f8d97;
    text-align: center;
}

.taskbar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    height: 58px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(241, 246, 249, 0.91);
    border-top: 1px solid rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px);
}

.start-button {
    width: 34px;
    height: 34px;
    border: 0;
    background:
        linear-gradient(90deg, #2c9ddd 0 47%, transparent 47% 53%, #2c9ddd 53% 100%),
        linear-gradient(#2c9ddd 0 47%, transparent 47% 53%, #2c9ddd 53% 100%);
}

.taskbar-apps {
    min-width: 0;
    flex: 1;
    display: flex;
    gap: 7px;
    overflow: hidden;
}

.taskbar-program {
    max-width: 190px;
    height: 39px;
    padding: 0 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    color: #274050;
    background: rgba(49, 116, 151, 0.1);
}

.taskbar-program.active {
    background: rgba(49, 116, 151, 0.22);
}

.taskbar-program img {
    width: 27px;
    height: 27px;
    object-fit: contain;
}

.taskbar-program span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.taskbar-user {
    display: flex;
    align-items: center;
    gap: 13px;
    color: #263d4c;
    font-size: 12px;
}

.taskbar-user strong {
    font-size: 11px;
}

.toast-container {
    position: fixed;
    right: 18px;
    bottom: 76px;
    z-index: 1000;
    width: min(360px, calc(100vw - 36px));
    display: grid;
    gap: 9px;
}

.toast {
    padding: 13px 15px;
    opacity: 0;
    transform: translateY(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    background: rgba(22, 32, 39, 0.96);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.28);
    transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-color: rgba(83, 199, 117, 0.55);
}

.toast.error {
    border-color: rgba(222, 76, 76, 0.65);
}

@media (max-width: 1100px) {
    .program-window,
    .personnel-window,
    .chat-window {
        left: 2vw;
        top: 2vh;
        width: 96vw;
        height: 90vh;
    }

    .reports-layout {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .personnel-layout {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .employee-row {
        grid-template-columns: minmax(0, 1fr) 170px auto;
    }

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


/* Rettungsdienst-Desktop: eigenes neutrales RD-Design */
.computer-desktop {
    background:
        radial-gradient(circle at 50% 45%, rgba(31, 87, 122, 0.25), transparent 30%),
        linear-gradient(135deg, #0c1c28 0%, #07131d 58%, #050d14 100%) !important;
}
.computer-desktop::before {
    content: "RD" !important;
    position: absolute !important;
    left: 52% !important;
    top: 48% !important;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    transform: translate(-50%, -50%) !important;
    color: rgba(255, 255, 255, 0.026) !important;
    font-size: min(50vw, 720px) !important;
    font-weight: 900 !important;
    letter-spacing: -0.09em !important;
    background: none !important;
    filter: none !important;
    opacity: 1 !important;
}
