/* ==========================================================
   WERKSTATT DASHBOARD
   Version 1.0
   Grundlayout
========================================================== */

/* ==========================================================
   FARBEN / VARIABLEN
========================================================== */

:root {
    --background: #f4f5f7;
    --card: #ffffff;
    --primary: #b71c1c;
    --text: #202020;
    --text-light: #666666;
    --shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    --radius: 12px;

    --title-size: 2rem;
    --subtitle-size: 1.2rem;
    --card-title-size: 1.5rem;
    --card-text-size: 1rem;
}


/* ==========================================================
   RESET / GRUNDLAGE
========================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background: var(--background);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    padding: 14px;
}


/* ==========================================================
   SEITEN
========================================================== */

#dashboard-page {
    width: calc(100vw - 28px);
    height: calc(100vh - 28px);
    overflow: hidden;
}

.hidden {
    display: none;
}

main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#dashboard-page main {
    height: calc(100vh - 120px);
    overflow: hidden;
}


/* ==========================================================
   STANDARD CARD
========================================================== */

.card {
    background: var(--card);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 18px;
}

h2 {
    color: var(--primary);
    margin-bottom: 8px;
}


/* ==========================================================
   HEADER
========================================================== */

#header {
    display: grid;
    grid-template-columns: 190px 280px 1fr;
    align-items: center;
    gap: 50px;

    min-height: 75px;
    margin-bottom: 12px;
    padding: 8px 22px;

    background: var(--card);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

#logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

#logo-container img {
    width: 90px;
    max-height: 85px;
    height: auto;
}

#title-container h1 {
    color: var(--primary);
    font-size: 28px;
    margin: 0;
}

#title-container span {
    color: var(--text-light);
    font-size: 15px;
}


/* ==========================================================
   MOTIVATION
========================================================== */

#motivation-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    text-align: right;
}

#motivation-container h2 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 1.2rem;
}

#motivation-text {
    color: var(--text);
    font-size: 1.2rem;
    font-style: italic;
}


/* ==========================================================
   OBERE KARTEN
========================================================== */

#top-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    flex: 0 0 auto;
}

#top-cards .card {
    min-height: 82px;
    padding: 12px 18px;
}


/* ==========================================================
   UHR
========================================================== */

#clock-card {
    display: grid;
    grid-template-columns: 60% 40%;
    align-items: center;
}

#clock-left {
    display: flex;
    align-items: center;
}

#clock-time {
    color: var(--text-light);
    font-size: 44px;
    font-weight: 500;
}

#clock-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
}

#clock-day {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: bold;
}

#clock-date {
    color: var(--text-light);
    font-size: 1rem;
}


/* ==========================================================
   UNFALLFREIE TAGE
========================================================== */

#accident-card {
    display: grid;
    grid-template-columns: 60% 40%;
    align-items: center;
}

#accident-left {
    display: flex;
    align-items: center;
}

#accident-days {
    color: var(--text-light);
    font-size: 44px;
    font-weight: 500;
}

#accident-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
}

#accident-title {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: bold;
}

#accident-subtitle {
    color: var(--text);
    font-size: 1rem;
}

#accident-date {
    margin-top: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
}


/* ==========================================================
   WETTER
========================================================== */

#weather-card {
    display: grid;
    grid-template-columns: 60% 40%;
    align-items: center;
}

#weather-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

#weather-temp {
    color: var(--text-light);
    font-size: 44px;
    font-weight: 500;
}

#weather-icon {
    font-size: 2rem;
}

#weather-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#weather-city {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: bold;
}

#weather-text {
    color: var(--text-light);
    font-size: 0.9rem;
}


/* ==========================================================
   FAHRZEUGE / GLEISBELEGUNG
========================================================== */

#vehicles {
    flex: 0 0 auto;

    background: var(--card);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);

    padding: 14px 22px;
    overflow: hidden;
}

#vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#vehicle-header h2 {
    margin: 0;
    font-size: 24px;
}

#gleisplan-status {
    color: var(--text-light);
    font-size: 0.9rem;
}

#gleisplan-image {
    display: block;
    width: 100%;
    height: auto;
    margin: auto;
}

#gleisplan-viewer {
    width: 100%;
    height: 100%;
    border: none;
}

#touch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}


/* ==========================================================
   UNTERER BEREICH
========================================================== */

#bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    flex: 0 0 auto;
}

.bottom-card {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 58px;
    padding: 12px 18px;
}

.bottom-card h2 {
    flex-shrink: 0;
    margin: 0;
    white-space: nowrap;
    font-size: 22px;
}


/* ==========================================================
   MENÜ UNTEN LINKS
========================================================== */

.dashboard-menu-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.menu-button {
    flex: 1;

    background: #f5f5f5;
    border: 2px solid var(--primary);
    border-radius: 10px;

    padding: 7px 10px;

    font-size: 14px;
    font-weight: bold;

    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.menu-button:hover {
    background: #eeeeee;
}


/* ==========================================================
   KURZE WERKSTATTINFORMATIONEN
========================================================== */

.info-short {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    flex-wrap: wrap;

    font-size: 16px;
}

.info-short span {
    white-space: nowrap;
}


/* ==========================================================
   ADMINISTRATION
========================================================== */

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.admin-card {
    cursor: pointer;
    text-align: left;
    transition: 0.25s;
}

.admin-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

#admin-back {
    width: 100%;
    cursor: pointer;
    font-size: 1.1rem;
}


/* ==========================================================
   SCROLLEN AUF UNTERSEITEN ERLAUBEN
========================================================== */

#admin-page,
#accident-page,
#info-page,
#interval-page,
#paths-page,
#sharepoint-page,
#fristen-page {
    height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 30px;
}


/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 1200px) {

    body {
        overflow: auto;
    }

    #dashboard-page {
        width: auto;
        height: auto;
        overflow: visible;
    }

    #dashboard-page main {
        height: auto;
        overflow: visible;
    }

    #top-cards {
        grid-template-columns: 1fr;
    }

    #bottom {
        grid-template-columns: 1fr;
    }

    .bottom-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-menu-buttons,
    .info-short {
        width: 100%;
    }

}

/* ==========================================================
   Admin-Schalter
========================================================== */

.admin-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: 12px;
    margin-bottom: 12px;

    font-size: 15px;
    font-weight: bold;
}

.admin-toggle-row input {
    width: 20px;
    height: 20px;
}

#grid-mode-card {
    cursor: default;
}

#save-grid-mode {
    width: 100%;
    margin-top: 8px;
}