/* TIMS driver Chauffeurdienst - klassisches Portaldesign
   Bewusst zurückhaltend: helles Layout, klare Karten, einfache Navigation. */

:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #1f2933;
    --muted: #6b7280;
    --border: #d9dee7;
    --border-soft: #e7ebf1;
    --primary: #1f4f8f;
    --primary-dark: #173b6b;
    --primary-soft: #eaf1fb;
    --danger: #b42318;
    --danger-soft: #fdecec;
    --success: #177245;
    --success-soft: #eaf7ef;
    --warning: #9a6700;
    --warning-soft: #fff6db;
    --shadow: 0 2px 8px rgba(15, 23, 42, .08);
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: calc(100% - 32px);
    max-width: none;
    margin: 14px auto 40px;
}

.card,
.panel,
.box,
section {
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card,
.panel,
.box {
    padding: 18px;
    margin-bottom: 16px;
}

/* Header */
.app-header {
    padding: 0;
    overflow: hidden;
}

.app-header__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    min-height: 86px;
    padding: 18px 22px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    border-bottom: 1px solid var(--border-soft);
}

.app-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.app-header__brand:hover {
    text-decoration: none;
}

.app-header__logo {
    width: min(250px, 42vw);
    max-height: 54px;
    object-fit: contain;
    flex: 0 0 auto;
}

.app-header__divider {
    width: 1px;
    height: 46px;
    background: var(--border-soft);
    flex: 0 0 auto;
}

.app-header__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-header__eyebrow {
    margin-bottom: 2px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.app-header__title {
    margin: 0;
    color: #111827;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.08;
}

.app-header__subtitle {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.2;
}

.app-header__user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 280px;
    padding: 8px 11px;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .05);
    flex: 0 0 auto;
}

.app-header__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 800;
    flex: 0 0 auto;
}

.app-header__user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.app-header__user-name {
    overflow: hidden;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-header__user-role {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

/* Navigation - klassisch hell, aber etwas sauberer strukturiert */
.app-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    width: 100%;
    padding: 9px 10px;
    margin-bottom: 18px;
    position: relative;
    z-index: 10;
}

.app-nav__link,
.app-nav__toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #24364b;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.app-nav__link:hover,
.app-nav__toggle:hover,
.app-nav__dropdown[open] > .app-nav__toggle,
.app-nav__dropdown.is-active > .app-nav__toggle,
.app-nav__link.is-active {
    background: var(--primary-soft);
    border-color: #c8d8ec;
    color: var(--primary-dark);
    text-decoration: none;
}

.app-nav__link.is-active,
.app-nav__dropdown.is-active > .app-nav__toggle {
    box-shadow: inset 0 -2px 0 rgba(31, 79, 143, .28);
}

.app-nav__link svg,
.app-nav__toggle svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.app-nav__dropdown {
    position: relative;
}

.app-nav__dropdown > summary {
    list-style: none;
}

.app-nav__dropdown > summary::-webkit-details-marker {
    display: none;
}

.app-nav__link-main {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.app-nav__caret {
    font-size: 11px;
    color: var(--muted);
    margin-left: 2px;
    transition: transform .15s ease;
}

.app-nav__dropdown[open] .app-nav__caret {
    transform: rotate(180deg);
}

.app-nav__submenu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 225px;
    padding: 7px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 9px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .13);
    z-index: 1000;
}

.app-nav__dropdown[open] > .app-nav__submenu,
.app-nav__dropdown:hover > .app-nav__submenu {
    display: block;
}

.app-nav__sublink {
    display: block;
    padding: 9px 10px;
    border-radius: 7px;
    color: #24364b;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.app-nav__sublink:hover,
.app-nav__sublink.is-active {
    background: var(--primary-soft);
    color: var(--primary-dark);
    text-decoration: none;
}
/* Typografie */
h1, h2, h3 {
    color: #111827;
    line-height: 1.2;
}

h1 {
    margin: 0 0 16px;
    font-size: 26px;
}

h2 {
    margin: 0 0 14px;
    font-size: 21px;
}

h3 {
    margin: 0 0 10px;
    font-size: 17px;
}

p {
    margin-top: 0;
}

small,
.muted,
.text-muted {
    color: var(--muted);
}

/* Formulare */
label {
    display: block;
    margin: 0 0 5px;
    font-weight: 600;
    color: #374151;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    max-width: 100%;
    padding: 9px 10px;
    border: 1px solid #cfd6e2;
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 79, 143, .12);
}

.form-row,
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.form-row > *,
.row > * {
    flex: 1 1 220px;
}

/* Buttons */
button,
.btn,
input[type="submit"],
input[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 13px;
    border: 1px solid #c5cfdd;
    border-radius: 7px;
    background: #fff;
    color: #24364b;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: #f2f5f9;
    text-decoration: none;
}

button.primary,
.btn.primary,
.btn-primary,
input[type="submit"] {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

button.primary:hover,
.btn.primary:hover,
.btn-primary:hover,
input[type="submit"]:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

button.danger,
.btn.danger,
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

button.danger:hover,
.btn.danger:hover,
.btn-danger:hover {
    background: #8f1d14;
    border-color: #8f1d14;
}

/* Tabellen */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 18px;
    background: #fff;
    border: 1px solid var(--border);
}

th,
td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: top;
    text-align: left;
}

th {
    background: #eef2f6;
    color: #24364b;
    font-weight: 700;
}

tr:nth-child(even) td {
    background: #fbfcfe;
}

tr:hover td {
    background: #f5f8fc;
}

.actions,
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* Hinweise / Meldungen */
.alert,
.notice,
.success,
.error,
.warning {
    padding: 10px 12px;
    margin: 0 0 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.success,
.alert-success {
    background: var(--success-soft);
    border-color: #b7e2c8;
    color: var(--success);
}

.error,
.alert-danger {
    background: var(--danger-soft);
    border-color: #f3b8b4;
    color: var(--danger);
}

.warning,
.alert-warning {
    background: var(--warning-soft);
    border-color: #f0d88d;
    color: var(--warning);
}

.notice,
.alert-info {
    background: var(--primary-soft);
    border-color: #c8d8ec;
    color: var(--primary-dark);
}

/* Badges / Status */
.badge,
.chip,
.role-pill,
.user-pill,
.status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2f6;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge.success,
.status.final,
.status.beendet,
.status.bezahlt {
    background: var(--success-soft);
    color: var(--success);
}

.badge.warning,
.status.offen,
.status.geplant {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge.danger,
.status.storniert {
    background: var(--danger-soft);
    color: var(--danger);
}

/* kleine Hilfsklassen */
.right,
.text-right {
    text-align: right;
}

.center,
.text-center {
    text-align: center;
}

.nowrap {
    white-space: nowrap;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-soft);
    margin: 18px 0;
}

/* Mobile */
@media (max-width: 760px) {
    .container {
        width: calc(100% - 12px);
        margin-top: 6px;
    }

    .app-header__content {
        flex-direction: column;
        align-items: flex-start;
        min-height: 0;
        padding: 15px;
    }

    .app-header__brand {
        width: 100%;
        gap: 12px;
    }

    .app-header__logo {
        width: min(220px, 58vw);
    }

    .app-header__divider {
        display: none;
    }

    .app-header__title {
        font-size: 21px;
    }

    .app-header__user {
        width: 100%;
        max-width: none;
        border-radius: 9px;
        justify-content: flex-start;
    }

    .app-nav {
        align-items: stretch;
    }

    .app-nav__link,
    .app-nav__dropdown,
    .app-nav__toggle {
        width: 100%;
    }

    .app-nav__toggle,
    .app-nav__link {
        justify-content: flex-start;
    }

    .app-nav__submenu {
        position: static;
        width: 100%;
        margin-top: 6px;
        box-shadow: none;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media print {
    .app-header,
    .app-nav,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .container {
        width: 100%;
        margin: 0;
    }

    .card,
    .panel,
    .box {
        box-shadow: none;
        border: 0;
    }
}
