/* ==================================================
   Einsatzleitrechner - Main Style
================================================== */

* {
    box-sizing: border-box;
}

:root {
    --primary:#b91c1c;
    --primary-dark:#7f1d1d;

    --dark:#111827;
    --dark-light:#1f2937;

    --bg:#f3f4f6;
    --card:#ffffff;

    --text:#111827;
    --muted:#6b7280;

    --border:#e5e7eb;

    --green:#16a34a;
    --yellow:#ca8a04;
    --red:#dc2626;
}


body {
    margin:0;
    background:var(--bg);
    color:var(--text);
    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;
}


/* ==================================================
   LOGIN
================================================== */

.login-body {

    min-height:100vh;

    display:flex;
    justify-content:center;
    align-items:center;

    background:
    linear-gradient(
        135deg,
        #111827,
        #450a0a
    );
}


.login-card {

    width:400px;

    background:white;

    padding:35px;

    border-radius:22px;

    box-shadow:
    0 25px 60px rgba(0,0,0,.35);
}


.login-card h1 {

    margin:0;
    font-size:28px;
}


.login-card p {

    color:var(--muted);
    margin-bottom:25px;
}


.error {

    padding:12px;

    background:#fee2e2;

    color:#991b1b;

    border-radius:10px;

    margin-bottom:15px;
}


/* ==================================================
   FORMS
================================================== */


label {

    display:block;

    font-weight:600;

    margin-bottom:6px;

}


input,
textarea,
select {


    width:100%;

    padding:13px 14px;

    border-radius:12px;

    border:1px solid #d1d5db;

    background:#fff;

    margin-bottom:18px;

    font-size:15px;

}


input:focus,
textarea:focus,
select:focus {


    outline:none;

    border-color:var(--primary);

    box-shadow:
    0 0 0 3px rgba(185,28,28,.15);

}



button,
.btn {


    display:inline-block;

    border:none;

    padding:12px 18px;

    background:var(--dark);

    color:white;

    border-radius:12px;

    cursor:pointer;

    text-decoration:none;

    font-size:15px;

}



button:hover,
.btn:hover {

    opacity:.9;

}



button.danger,
.btn.danger {

    background:var(--primary);

}




/* ==================================================
   LAYOUT
================================================== */


.layout {

    min-height:100vh;

    display:flex;

}



/* SIDEBAR */

.sidebar {


    width:270px;

    background:
    linear-gradient(
        180deg,
        #111827,
        #030712
    );


    color:white;

    padding:25px;

}


.sidebar h2 {

    margin-top:0;

    color:#ef4444;

    font-size:26px;

    letter-spacing:1px;

}



.sidebar a {


    display:block;

    color:#d1d5db;

    padding:13px 14px;

    margin-bottom:8px;

    border-radius:12px;

    text-decoration:none;

    transition:.2s;

}



.sidebar a:hover,
.sidebar a.active {


    background:var(--primary);

    color:white;

}




/* MAIN */


.main {


    flex:1;

    padding:32px;

}



.topbar {


    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:30px;

}



.topbar h1 {

    margin:0;

}



.topbar p {


    margin-top:6px;

    color:var(--muted);

}



.badge {

    padding:9px 16px;

    background:var(--dark);

    color:white;

    border-radius:100px;

}





/* ==================================================
   DASHBOARD CARDS
================================================== */


.cards {

    display:grid;

    grid-template-columns:
    repeat(3,1fr);

    gap:22px;

}


.card {


    background:white;

    border-radius:20px;

    padding:26px;

    box-shadow:
    0 10px 30px rgba(0,0,0,.07);


}



.card h3 {

    margin:0 0 15px;

    color:var(--muted);

    font-size:15px;

}



.card strong {

    font-size:46px;

    color:var(--primary);

}




/* ==================================================
   PANELS
================================================== */


.panel,
.form-box {


    background:white;

    border-radius:20px;

    padding:25px;

    box-shadow:
    0 10px 30px rgba(0,0,0,.07);

}



.panel {

    margin-top:25px;

}



.panel-header,
.window-header {


    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:22px;

}



.panel-header h2,
.window-header h1 {

    margin:0;

}



.window-header p {

    margin-top:5px;

    color:var(--muted);

}




/* ==================================================
   TABLE
================================================== */


table {

    width:100%;

    border-collapse:collapse;

}



th {

    text-align:left;

    color:#6b7280;

    font-size:13px;

    padding:12px;

    border-bottom:2px solid var(--border);

}


td {

    padding:14px 12px;

    border-bottom:1px solid var(--border);

}



tr:hover {

    background:#f9fafb;

}




/* ==================================================
   EINSATZ FENSTER
================================================== */


.window-page {

    padding:30px;

}



.grid-2 {

    display:grid;

    grid-template-columns:1fr 1fr;

    gap:20px;

}



.grid-3 {

    display:grid;

    grid-template-columns:2fr 1fr 1.5fr;

    gap:20px;

}




.actions {


    display:flex;

    justify-content:flex-end;

    gap:12px;

}




/* ==================================================
   STATUS
================================================== */

.status {


    padding:6px 12px;

    border-radius:100px;

    color:white;

    font-size:13px;

}


.status.offen {

    background:var(--red);

}


.status.laufend {

    background:var(--yellow);

}


.status.geschlossen {

    background:var(--green);

}




/* ==================================================
   RESPONSIVE
================================================== */


@media(max-width:900px){


    .layout {

        flex-direction:column;

    }


    .sidebar {

        width:100%;

    }


    .cards,
    .grid-2,
    .grid-3 {

        grid-template-columns:1fr;

    }


}

.desktop-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.desktop {
    position: relative;
    min-height: 620px;
    background: #0f3554;
    border-radius: 18px;
    overflow: hidden;
    padding: 20px;
}

.start-panel {
    margin-top: 0;
}

.app-window {
    position: absolute;
    top: 40px;
    left: 40px;
    width: 1100px;
    height: 740px;
    background: #123f63;
    border: 1px solid #315f83;
    box-shadow: 0 20px 50px rgba(0,0,0,.35);
    border-radius: 8px;
    overflow: hidden;
}

.app-window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.app-window-header {
    height: 38px;
    background: #0b2238;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    font-weight: bold;
}

.app-window-header button {
    background: transparent;
    color: white;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
}

.app-window iframe {
    width: 100%;
    height: calc(100% - 38px);
    border: none;
    background: #123f63;
}

/* ==================================================
   ELR EINSATZBEARBEITUNG
   Aufbau ähnlich Leitstellenfenster, eigenes Design
================================================== */

.dispatcher-body {
    margin: 0;
    background: #eef2f7;
    color: #111827;
    overflow: hidden;
}

.dispatcher {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #eef2f7;
}

.dispatcher-top {
    height: 58px;
    background: #ffffff;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 0 18px;
    border-bottom: 1px solid #d8dee8;
    box-shadow: 0 2px 12px rgba(15, 23, 42, .06);
}

.dispatcher-brand {
    width: 250px;
    display: flex;
    flex-direction: column;
}

.dispatcher-brand strong {
    color: #b91c1c;
    font-size: 17px;
}

.dispatcher-brand span {
    color: #64748b;
    font-size: 12px;
}

.dispatcher-top nav {
    flex: 1;
    display: flex;
    gap: 8px;
}

.dispatcher-top nav button {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #d8dee8;
    padding: 8px 12px;
    border-radius: 10px;
}

.dispatcher-top nav button:hover {
    background: #e2e8f0;
}

.dispatcher-time {
    color: #475569;
    background: #f8fafc;
    border: 1px solid #d8dee8;
    padding: 8px 12px;
    border-radius: 999px;
}

.dispatcher-main {
    flex: 1;
    display: grid;
    grid-template-columns: 520px 1fr 360px;
    gap: 14px;
    padding: 14px;
    min-height: 0;
}

.incident-left,
.resources,
.documentation {
    background: #ffffff;
    border: 1px solid #d8dee8;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
    overflow: hidden;
}

.incident-left {
    padding: 14px;
    overflow-y: auto;
}

.resources,
.documentation {
    display: flex;
    flex-direction: column;
}

.dispatcher input,
.dispatcher textarea,
.dispatcher select {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #111827;
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 12px 13px;
}

.dispatcher input::placeholder,
.dispatcher textarea::placeholder {
    color: #94a3b8;
}

.dispatcher input:focus,
.dispatcher textarea:focus,
.dispatcher select:focus {
    border-color: #b91c1c;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, .12);
}

.dispatcher-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dispatcher-row.small-right {
    grid-template-columns: 1fr 125px;
}

.dispatcher-row.small-button {
    grid-template-columns: 1fr 46px;
}

.address-display {
    min-height: 58px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #7c2d12;
    margin-bottom: 10px;
    padding: 13px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.address-display button,
.dispatcher-row button {
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 10px;
    border-radius: 10px;
}

.priority {
    background: #f8fafc;
    border: 1px solid #d8dee8;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.priority span {
    font-weight: 700;
    color: #334155;
}

.priority label {
    margin: 0;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 5px;
}

.priority input {
    width: auto;
    margin: 0;
}

.resources-header,
.doc-header {
    min-height: 62px;
    background: #ffffff;
    border-bottom: 1px solid #d8dee8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
}

.resources-header h2,
.doc-header h2 {
    margin: 0;
    font-size: 20px;
    color: #111827;
}

.resources-header div {
    display: flex;
    gap: 8px;
}

.resources-header button,
.doc-header button {
    border-radius: 10px;
    padding: 10px 14px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-clear {
    background: #f8fafc !important;
    color: #991b1b !important;
    border-color: #fecaca !important;
}

.btn-suggest {
    background: #fff7ed !important;
    color: #9a3412 !important;
    border-color: #fed7aa !important;
}

.btn-dispatch {
    background: #b91c1c !important;
    color: white !important;
    border-color: #b91c1c !important;
}

.vehicle-list {
    flex: 1;
    overflow-y: auto;
    background: #f8fafc;
}

.empty-resources {
    height: 100%;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-align: center;
    gap: 8px;
    padding: 30px;
}

.empty-resources strong {
    color: #111827;
    font-size: 20px;
}

.empty-resources span {
    max-width: 420px;
    font-size: 14px;
}

.documentation textarea {
    height: 130px;
    resize: none;
    border-radius: 0;
    margin: 0;
    border-left: none;
    border-right: none;
}

.doc-log {
    flex: 1;
    padding: 14px;
    background: #f8fafc;
    overflow-y: auto;
}

.doc-log div {
    background: #ffffff;
    border: 1px solid #d8dee8;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 8px;
}

@media(max-width:1200px) {
    .dispatcher-main {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .dispatcher-body {
        overflow: auto;
    }
}

.save-toast {
    position: fixed;
    top: 72px;
    right: 24px;
    background: #16a34a;
    color: white;
    padding: 13px 18px;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
    z-index: 9999;
    font-weight: 700;
}

.click-row {
    cursor: pointer;
}

.click-row:hover {
    background: #fee2e2 !important;
}
.admin-card {
    display: block;
    background: white;
    color: #111827;
    text-decoration: none;
    border-radius: 20px;
    padding: 26px;
    box-shadow: 0 10px 30px rgba(0,0,0,.07);
    border: 1px solid #e5e7eb;
}

.admin-card:hover {
    border-color: #b91c1c;
    transform: translateY(-2px);
}

.admin-card h3 {
    margin: 0 0 10px;
    color: #b91c1c;
}

.admin-card p {
    margin: 0;
    color: #6b7280;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.check-field {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.check-field input {
    width: auto;
    transform: scale(1.3);
}

.admin-card {
    display: block;
    background: white;
    color: #111827;
    text-decoration: none;
    border-radius: 20px;
    padding: 26px;
    box-shadow: 0 10px 30px rgba(0,0,0,.07);
    border: 1px solid #e5e7eb;
}

.admin-card:hover {
    border-color: #b91c1c;
    transform: translateY(-2px);
}

.admin-card h3 {
    margin: 0 0 10px;
    color: #b91c1c;
}

.admin-card p {
    margin: 0;
    color: #6b7280;
}

.vehicle-select-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px 0 22px;
}

.vehicle-select-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #d8dee8;
    border-radius: 14px;
    padding: 12px;
    cursor: pointer;
}

.vehicle-select-item:hover {
    border-color: #b91c1c;
}

.vehicle-select-item input {
    width: auto;
    margin-top: 4px;
}

.vehicle-select-item span {
    display: flex;
    flex-direction: column;
}

.vehicle-select-item small {
    color: #64748b;
}

.address-search-wrap {
    position: relative;
}

.address-suggestions {
    display: none;
    position: absolute;
    z-index: 5000;
    top: 48px;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
}

.address-suggestion {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: white;
    color: #111827;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 14px;
    border-radius: 0;
}

.address-suggestion:hover {
    background: #f8fafc;
}

.address-suggestion span {
    font-size: 13px;
    color: #64748b;
}

.address-suggestion.empty {
    cursor: default;
}