/* Ergänzungen zu Bootstrap. Alles Weitere kommt aus dem Framework. */

/* Damit Text in Flex-Zeilen abgeschnitten statt gequetscht wird. */
.min-w-0 {
    min-width: 0;
}

/* Untere Navigation für kleine Bildschirme; oben bleibt sie ausgeblendet. */
.bottom-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1030;
    display: flex;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav a {
    flex: 1;
    padding: 0.5rem 0 0.4rem;
    text-align: center;
    text-decoration: none;
    color: var(--bs-secondary-color);
    font-size: 0.7rem;
}

.bottom-nav a.active {
    color: var(--bs-primary);
}

.bottom-nav a i {
    display: block;
    font-size: 1.15rem;
    margin-bottom: 0.15rem;
}

/* Platz für die untere Navigation, damit sie nichts überdeckt. */
@media (max-width: 767.98px) {
    .pb-nav {
        padding-bottom: calc(4.25rem + env(safe-area-inset-bottom)) !important;
    }
}

/* TomSelect an die Höhe der Bootstrap-Formularfelder angleichen. */
.ts-wrapper.form-select {
    padding: 0;
}

/* --- Kopfleiste: zwei Zeilen ------------------------------------------- */
.md-topbar  { min-height: 2.75rem; }
.md-mainnav { padding-bottom: .4rem; }

/* --- Namenszeichen ------------------------------------------------------ */
.md-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    line-height: 1;
    /* Feiner Innenrand, damit der Kreis auch auf einfarbigem Grund Form behält. */
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.md-avatar--sm { width: 30px; height: 30px; font-size: .78rem; }
.md-avatar--lg { width: 56px; height: 56px; font-size: 1.25rem; }

/* --- Reiter ------------------------------------------------------------- */
.md-tabs { border-bottom: 1px solid var(--bs-border-color); gap: .25rem; }
.md-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--bs-secondary-color);
    padding: .5rem .85rem;
}
.md-tabs .nav-link.active {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-primary);
    font-weight: 600;
    background: none;
}

/* --- Karten ------------------------------------------------------------- */
.md-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
    gap: 1rem;
}
.md-card {
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    padding: 1rem;
}
.md-card__title { font-size: 1rem; font-weight: 600; margin-bottom: .25rem; }
.md-card__help  { font-size: .85rem; color: var(--bs-secondary-color); margin-bottom: .75rem; }
.md-label       { font-size: .8rem; color: var(--bs-secondary-color); margin-bottom: .15rem; }

/* --- Farbauswahl -------------------------------------------------------- */
.md-swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.md-swatch__input { position: absolute; opacity: 0; width: 0; height: 0; }
.md-swatch {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
    transition: transform .12s, box-shadow .12s;
}
.md-swatch:hover { transform: scale(1.12); }
/* Kein Häkchen als Markierung – das würde die zwei Buchstaben verdecken. */
.md-swatch__input:checked + .md-swatch {
    transform: scale(1.12);
    box-shadow: 0 0 0 2px var(--bs-body-bg), 0 0 0 4px currentColor, inset 0 0 0 1px rgba(255, 255, 255, .5);
}
.md-swatch__input:focus-visible + .md-swatch {
    outline: 3px solid var(--bs-primary);
    outline-offset: 3px;
}

/* --- Pillen und Hinweisblock -------------------------------------------- */
.md-pill {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}
.md-pill--waiting { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.md-pill--muted   { background: var(--bs-secondary-bg);      color: var(--bs-secondary-color); }
.md-notice {
    border: 1px solid var(--bs-border-color);
    border-left: 3px solid var(--bs-warning);
    border-radius: .375rem;
    padding: .6rem .75rem;
}

/* --- Protokolltabelle --------------------------------------------------- */
.md-activities td { border-color: var(--bs-border-color); }
