/* HS Auftragsverwaltung – eigenständiges Design auf Bootstrap-5-Basis (Farben, Layout, Komponenten). */

:root {
    --hs-bg: #f3f5f8;
    --hs-surface: #ffffff;
    --hs-border: #e2e6ec;
    --hs-text: #1c2430;
    --hs-text-muted: #667085;

    --hs-primary: #2453ff;
    --hs-primary-dark: #1a3fd1;
    --hs-primary-soft: #eaefff;

    --hs-sidebar-bg: #10192e;
    --hs-sidebar-bg-active: #1c2b4a;
    --hs-sidebar-text: #aab4c8;
    --hs-sidebar-text-active: #ffffff;

    --hs-radius: 10px;
    --hs-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);

    --hs-status-offen: #667085;
    --hs-status-terminiert: #2453ff;
    --hs-status-in_bearbeitung: #c77d00;
    --hs-status-weitere_termine_erforderlich: #e05d00;
    --hs-status-abgeschlossen: #12875a;
    --hs-status-storniert: #d1293d;
    --hs-status-in_abrechnung: #7c3aed;
    --hs-status-abgerechnet: #0f766e;
}

* { box-sizing: border-box; }

body {
    background-color: var(--hs-bg);
    color: var(--hs-text);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

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

/* ---------- App-Shell: Sidebar + Content ---------- */

.hs-shell { display: flex; min-height: 100vh; }

.hs-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--hs-sidebar-bg);
    color: var(--hs-sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.hs-sidebar-brand {
    padding: 1.1rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.hs-sidebar-brand .brand-main {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    line-height: 1.25;
}
.hs-sidebar-brand .brand-sub {
    margin-top: .15rem;
    font-size: .72rem;
    color: var(--hs-sidebar-text);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.hs-impersonation-banner {
    background: #b45309;
    color: #fff;
    font-size: .78rem;
    padding: .5rem 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.hs-impersonation-banner a,
.hs-impersonation-banner button { color: #fff; text-decoration: underline; font-weight: 600; }

.hs-nav { flex: 1; padding: .75rem .6rem; overflow-y: auto; }

.hs-nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .75rem;
    border-radius: 8px;
    color: var(--hs-sidebar-text);
    font-size: .92rem;
    margin-bottom: .15rem;
}

.hs-nav-link:hover { background: var(--hs-sidebar-bg-active); color: var(--hs-sidebar-text-active); }
.hs-nav-link.active { background: var(--hs-primary); color: #fff; font-weight: 600; }

.hs-nav-section {
    padding: .9rem .75rem .25rem;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #5c6a8a;
}

.hs-sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .85rem;
}
.hs-sidebar-footer .footer-user { color: #fff; font-weight: 600; }
.hs-sidebar-footer .footer-mandant { color: var(--hs-sidebar-text); font-size: .76rem; margin-top: .1rem; }
.hs-sidebar-footer form button { color: var(--hs-sidebar-text); }

.hs-content { flex: 1; min-width: 0; }

.hs-topbar {
    background: var(--hs-surface);
    border-bottom: 1px solid var(--hs-border);
    padding: .9rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hs-topbar h1 { font-size: 1.25rem; font-weight: 700; margin: 0; }

.hs-page { padding: 1.75rem; width: 100%; }
.hs-page-narrow { max-width: 900px; }

/* ---------- Karten / Tabellen / Formulare ---------- */

.hs-card {
    background: var(--hs-surface);
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius);
    box-shadow: var(--hs-shadow);
}
.hs-card .card-body { padding: 1.25rem 1.4rem; }

.hs-stat { text-align: center; padding: 1rem .5rem; }
.hs-stat .hs-stat-value { font-size: 1.7rem; font-weight: 700; color: var(--hs-text); }
.hs-stat .hs-stat-label { font-size: .8rem; color: var(--hs-text-muted); margin-top: .15rem; }

.table { --bs-table-bg: transparent; }
.hs-table thead th {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--hs-text-muted);
    border-bottom: 1px solid var(--hs-border);
    font-weight: 600;
}
.hs-table td { vertical-align: middle; border-color: var(--hs-border); }
.hs-table tbody tr:hover { background: var(--hs-primary-soft); }

.btn-primary {
    background: var(--hs-primary);
    border-color: var(--hs-primary);
}
.btn-primary:hover { background: var(--hs-primary-dark); border-color: var(--hs-primary-dark); }
.btn-outline-primary { color: var(--hs-primary); border-color: var(--hs-primary); }

.form-control:focus, .form-select:focus {
    border-color: var(--hs-primary);
    box-shadow: 0 0 0 .2rem var(--hs-primary-soft);
}

/* ---------- Status-Badges ---------- */

.hs-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .6rem;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.hs-status::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: rgba(255,255,255,.85); }

.hs-status-OFFEN { background: var(--hs-status-offen); }
.hs-status-TERMINIERT { background: var(--hs-status-terminiert); }
.hs-status-IN_BEARBEITUNG { background: var(--hs-status-in_bearbeitung); }
.hs-status-WEITERE_TERMINE_ERFORDERLICH { background: var(--hs-status-weitere_termine_erforderlich); }
.hs-status-ABGESCHLOSSEN { background: var(--hs-status-abgeschlossen); }
.hs-status-STORNIERT { background: var(--hs-status-storniert); }
.hs-status-IN_ABRECHNUNG { background: var(--hs-status-in_abrechnung); }
.hs-status-ABGERECHNET { background: var(--hs-status-abgerechnet); }

.hs-pill {
    display: inline-flex;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
    background: var(--hs-primary-soft);
    color: var(--hs-primary-dark);
}

.hs-bild-typ-VORHER { background: #fff3d6; color: #8a5a00; }
.hs-bild-typ-NACHHER { background: #d9f2e6; color: #12875a; }

.hs-pill-success { background: #d9f2e6; color: #12875a; }
.hs-pill-danger { background: #fde3e3; color: #d1293d; }

/* ---------- Auftragsdetails: Info-Grid, Timeline, Status-Punkt, Funktions-Links ---------- */

.hs-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.1rem 1.5rem;
}
.hs-info-item .label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--hs-text-muted);
    font-weight: 600;
    margin-bottom: .2rem;
}
.hs-info-item .label i { width: 1em; text-align: center; color: var(--hs-primary); }
.hs-info-item .value { font-size: .95rem; }
.hs-info-item .value.hs-empty { color: var(--hs-text-muted); font-style: italic; }

.hs-timeline { position: relative; padding-left: 1.4rem; }
.hs-timeline::before {
    content: "";
    position: absolute;
    left: .28rem;
    top: .3rem;
    bottom: .3rem;
    width: 2px;
    background: var(--hs-border);
}
.hs-timeline-item { position: relative; padding-bottom: 1.1rem; }
.hs-timeline-item:last-child { padding-bottom: 0; }
.hs-timeline-item::before {
    content: "";
    position: absolute;
    left: -1.4rem;
    top: .25rem;
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    background: var(--hs-primary);
    box-shadow: 0 0 0 3px var(--hs-surface);
}

.hs-status-dot {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    margin-right: .5rem;
    flex-shrink: 0;
}

.hs-quick-link {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.hs-quick-link i { width: 1.1em; text-align: center; }

/* ---------- Responsiv (Tablet) ---------- */

@media (max-width: 900px) {
    .hs-shell { flex-direction: column; }
    .hs-sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    .hs-sidebar-brand { border-bottom: none; }
    .hs-impersonation-banner { justify-content: center; }
    .hs-nav { display: flex; flex-wrap: wrap; padding: .5rem .75rem; }
    .hs-nav-section { display: none; }
    .hs-nav-link { padding: .4rem .65rem; }
    .hs-sidebar-footer { margin-left: auto; border-top: none; }
    .hs-page { padding: 1rem; }
}
