/*
 * HWList – modernes, gut lesbares Erscheinungsbild für AdminLTE
 *
 * Ziele: Lager-PC (1–2 m Abstand), Handy und MDE (Zebra/Honeywell, ~4–5")
 * - Grundschrift 16 px (verhindert auch das Auto-Zoom auf iOS/Android bei Eingabefeldern)
 * - Touch-Ziele mindestens 44 px
 * - ruhige Flächen, klare Ränder statt schwerer Schatten
 * Wird nach adminlte.min.css und brand.css geladen und überschreibt nur Darstellung.
 */

:root {
    --hw-accent: var(--hw-red, #F04648);
    --hw-accent-dark: #c9302f;
    --hw-accent-soft: rgba(240, 70, 72, 0.10);

    --hw-bg: #f3f4f7;
    --hw-surface: #ffffff;
    --hw-surface-2: #f8f9fb;
    --hw-border: #e2e5eb;
    --hw-border-strong: #c9ced8;
    --hw-text: #1b1e25;
    --hw-muted: #5d6573;

    --hw-sidebar: #15171c;
    --hw-sidebar-text: #c6cad3;
    --hw-sidebar-hover: #23262d;

    --hw-ok: #16a34a;
    --hw-warn: #d97706;
    --hw-bad: #dc2626;
    --hw-info: #2563eb;

    --hw-radius: 12px;
    --hw-radius-sm: 8px;
    --hw-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    --hw-shadow-lg: 0 10px 30px rgba(16, 24, 40, 0.12);
    --hw-focus: 0 0 0 3px rgba(37, 99, 235, 0.35);

    --hw-font: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --hw-mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, 'SFMono-Regular', Menlo, monospace;
    --hw-fs: 16px;
    --hw-touch: 44px;
}

/* ---------- Grundlage ---------- */
html { font-size: var(--hw-fs); -webkit-text-size-adjust: 100%; }

body,
button, input, textarea, select,
.btn, .form-control, .custom-select, .dropdown-menu, .table, .badge {
    font-family: var(--hw-font) !important;
}

body {
    font-size: 1rem !important;
    line-height: 1.5 !important;
    color: var(--hw-text);
    background: var(--hw-bg);
    -webkit-font-smoothing: antialiased;
}

.content-wrapper { background: var(--hw-bg) !important; }

h1, .h1 { font-size: 1.6rem !important; font-weight: 700 !important; letter-spacing: -0.01em; }
h2, .h2 { font-size: 1.35rem !important; font-weight: 650 !important; }
h3, .h3 { font-size: 1.15rem !important; font-weight: 600 !important; }
h4, .h4 { font-size: 1.08rem !important; font-weight: 600 !important; }
h5, .h5 { font-size: 1rem !important; font-weight: 600 !important; }
small, .small { font-size: 0.875rem !important; }
.text-muted { color: var(--hw-muted) !important; }

a { color: var(--hw-info); }
a:hover { color: #1d4ed8; }

code, kbd, pre, samp, .hw-mono { font-family: var(--hw-mono) !important; }

/* Sichtbarer Fokus für Tastaturbedienung */
:focus-visible { outline: none; box-shadow: var(--hw-focus) !important; }

/* ---------- Kopfzeile ---------- */
.main-header.navbar {
    background: var(--hw-surface) !important;
    border-bottom: 1px solid var(--hw-border) !important;
    min-height: 56px;
    box-shadow: none !important;
}
.main-header .nav-link { color: var(--hw-text) !important; min-height: var(--hw-touch); display: flex; align-items: center; }

.content-header { padding: 18px 0.75rem 6px !important; }
.content-header h1 { margin: 0; }
.breadcrumb { background: transparent; font-size: 0.875rem; margin: 0; padding: 0; }

/* ---------- Seitenleiste ---------- */
.main-sidebar, .main-sidebar .sidebar { background: var(--hw-sidebar) !important; }
.main-sidebar { padding-left: 0 !important; box-shadow: none !important; border-right: 1px solid #0c0d10; }
/* Logo oben links: so hoch wie die Kopfzeile, Text statt SVG (SVG-Text sass schief) */
.main-sidebar .hw-brand { display: flex; align-items: center; height: 57px; padding: 0 1rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); text-decoration: none; overflow: hidden; white-space: nowrap; }
.hw-brand-box { flex: 0 0 34px; height: 34px; border-radius: 9px; background: var(--hw-accent); color: #fff; font-weight: 800; font-size: .95rem; letter-spacing: -.02em; display: flex; align-items: center; justify-content: center; }
.hw-brand-name { margin-left: .6rem; font-weight: 800; font-size: 1.2rem; letter-spacing: .02em; color: #fff; transition: opacity .2s; }
.hw-brand-name span { color: var(--hw-accent); }
.sidebar-collapse:not(.sidebar-is-opening) .main-sidebar:not(:hover) .hw-brand { padding: 0 .75rem; }
.sidebar-collapse:not(.sidebar-is-opening) .main-sidebar:not(:hover) .hw-brand-name { opacity: 0; }

/* Benutzer in der Seitenleiste */
.hw-user { display: flex; align-items: center; gap: .65rem; margin: .75rem .5rem; padding: .55rem .6rem; border-radius: 10px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.hw-user-av { flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--hw-accent); color: #fff; font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; }
.hw-user-txt { min-width: 0; flex: 1; line-height: 1.15; }
.hw-user-txt b { display: block; color: #fff; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-user-txt small { color: var(--hw-sidebar-text); opacity: .75; font-size: .75rem; }
.hw-user-out { color: var(--hw-sidebar-text); padding: .35rem .45rem; border-radius: 6px; }
.hw-user-out:hover, .hw-user-out:focus { color: #fff; background: rgba(255, 255, 255, 0.08); }
.sidebar-collapse:not(.sidebar-is-opening) .main-sidebar:not(:hover) .hw-user { padding: .55rem .3rem; background: none; }
.sidebar-collapse:not(.sidebar-is-opening) .main-sidebar:not(:hover) .hw-user-txt,
.sidebar-collapse:not(.sidebar-is-opening) .main-sidebar:not(:hover) .hw-user-out { display: none; }

.nav-sidebar .nav-link {
    color: var(--hw-sidebar-text) !important;
    border-radius: var(--hw-radius-sm) !important;
    margin: 2px 8px !important;
    padding: 10px 12px !important;
    font-size: 0.95rem;
    width: auto !important;
}
.nav-sidebar .nav-link:hover { background: var(--hw-sidebar-hover) !important; color: #fff !important; }
.nav-sidebar > .nav-item > .nav-link.active,
.nav-sidebar .nav-treeview .nav-link.active {
    background: var(--hw-accent) !important;
    color: #fff !important;
    box-shadow: none !important;
}
.nav-sidebar .nav-header {
    color: #7d8391 !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 18px 20px 6px !important;
}
.nav-sidebar .nav-icon { width: 1.6rem !important; font-size: 1rem !important; }

/* ---------- Karten ---------- */
.card {
    background: var(--hw-surface);
    border: 1px solid var(--hw-border) !important;
    border-radius: var(--hw-radius) !important;
    box-shadow: var(--hw-shadow) !important;
    margin-bottom: 1rem;
}
.card-outline { border-top-width: 1px !important; }
.card-outline.card-primary,
.card-outline.card-success,
.card-outline.card-info,
.card-outline.card-warning,
.card-outline.card-danger { border-top: 3px solid var(--hw-border-strong) !important; }
.card-outline.card-primary { border-top-color: var(--hw-accent) !important; }
.card-outline.card-success { border-top-color: var(--hw-ok) !important; }
.card-outline.card-info { border-top-color: var(--hw-info) !important; }
.card-outline.card-warning { border-top-color: var(--hw-warn) !important; }
.card-outline.card-danger { border-top-color: var(--hw-bad) !important; }

.card-header:not([class*="bg-"]) {
    background: transparent !important;
}
.card-header {
    border-bottom: 1px solid var(--hw-border) !important;
    padding: 0.9rem 1.1rem !important;
}
.card-header[class*="bg-"] { border-radius: calc(var(--hw-radius) - 1px) calc(var(--hw-radius) - 1px) 0 0 !important; }
.card-title { font-size: 1.05rem !important; font-weight: 600 !important; }
.card-body { padding: 1.1rem !important; }
.card-footer { background: var(--hw-surface-2) !important; border-top: 1px solid var(--hw-border) !important; border-radius: 0 0 var(--hw-radius) var(--hw-radius) !important; }

/* ---------- Kennzahlen-Boxen ---------- */
.info-box, .small-box {
    border-radius: var(--hw-radius) !important;
    box-shadow: var(--hw-shadow) !important;
    border: 1px solid var(--hw-border);
    min-height: 72px;
}
.info-box .info-box-icon { border-radius: var(--hw-radius-sm) !important; }
.info-box-number { font-size: 1.4rem; font-weight: 700 !important; font-variant-numeric: tabular-nums; }
.info-box-text { font-size: 0.85rem; text-transform: none !important; }

/* ---------- Buttons ---------- */
.btn {
    min-height: var(--hw-touch);
    padding: 0.55rem 1rem;
    border-radius: var(--hw-radius-sm) !important;
    font-weight: 600 !important;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    box-shadow: none !important;
    transition: background-color .12s ease, border-color .12s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm, .btn-group-sm > .btn { min-height: 36px; padding: 0.35rem 0.7rem; font-size: 0.9rem; }
.btn-lg, .btn-group-lg > .btn { min-height: 52px; font-size: 1.1rem; padding: 0.7rem 1.25rem; }
.btn-xs { min-height: 30px; font-size: 0.8rem; }
.btn-block { display: flex; width: 100%; }
.btn-group > .btn { border-radius: 0 !important; }
.btn-group > .btn:first-child { border-radius: var(--hw-radius-sm) 0 0 var(--hw-radius-sm) !important; }
.btn-group > .btn:last-child { border-radius: 0 var(--hw-radius-sm) var(--hw-radius-sm) 0 !important; }
.btn-group > .btn:only-child { border-radius: var(--hw-radius-sm) !important; }
.btn-group-vertical > .btn { border-radius: 0 !important; }

.btn-primary, .btn.btn-primary { background: var(--hw-accent) !important; border-color: var(--hw-accent) !important; color: #fff !important; }
.btn-primary:hover { background: var(--hw-accent-dark) !important; border-color: var(--hw-accent-dark) !important; }
.btn-success { background: var(--hw-ok) !important; border-color: var(--hw-ok) !important; }
.btn-default, .btn-light, .btn-secondary.btn-outline {
    background: var(--hw-surface) !important; border: 1px solid var(--hw-border-strong) !important; color: var(--hw-text) !important;
}
.btn-tool { min-height: 32px; }

/* ---------- Formulare ---------- */
.form-control, .custom-select, .select2-container .select2-selection--single {
    min-height: var(--hw-touch);
    font-size: 1rem !important;
    border: 1px solid var(--hw-border-strong) !important;
    border-radius: var(--hw-radius-sm) !important;
    background-color: var(--hw-surface);
    color: var(--hw-text);
    box-shadow: none !important;
}
textarea.form-control { min-height: 88px; }
.form-control-sm, .custom-select-sm { min-height: 38px; font-size: 0.95rem !important; }
.form-control-lg { min-height: 54px; font-size: 1.15rem !important; }
.form-control:focus, .custom-select:focus { border-color: var(--hw-info) !important; box-shadow: var(--hw-focus) !important; }
.input-group-text { background: var(--hw-surface-2); border-color: var(--hw-border-strong); border-radius: var(--hw-radius-sm); }
.input-group > .form-control:not(:last-child) { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-group > .form-control:not(:first-child) { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.input-group-prepend .input-group-text { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group-append .btn, .input-group-append .input-group-text { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
label, .col-form-label { font-weight: 600 !important; font-size: 0.92rem; color: var(--hw-text); margin-bottom: 0.3rem; }
.form-group { margin-bottom: 1rem; }
.custom-control-label::before, .custom-control-label::after { width: 1.25rem; height: 1.25rem; top: 0.1rem; }
.custom-control { min-height: 1.6rem; padding-left: 1.9rem; }
.form-check-input { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; }
.form-check-label { padding-left: 0.3rem; }

/* ---------- Tabellen ---------- */
.table { color: var(--hw-text); font-size: 0.95rem; }
.table thead th {
    background: var(--hw-surface-2);
    border-bottom: 1px solid var(--hw-border) !important;
    border-top: 0 !important;
    color: var(--hw-muted);
    font-size: 0.78rem;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.table td, .table th { padding: 0.7rem 0.8rem !important; vertical-align: middle !important; border-color: var(--hw-border) !important; }
.table-sm td, .table-sm th { padding: 0.45rem 0.6rem !important; }
.table-hover tbody tr:hover { background: #f2f5fb; }
.table-striped tbody tr:nth-of-type(odd) { background: #fafbfc; }

/* ---------- Badges, Alerts, Modals ---------- */
.badge { border-radius: 999px; padding: 0.35em 0.7em; font-weight: 600 !important; font-size: 0.8rem; }
.alert { border-radius: var(--hw-radius) !important; border: 1px solid transparent; font-size: 1rem; }
.alert-success { background: #e8f6ee !important; border-color: #b8e3c8 !important; color: #14532d !important; }
.alert-danger { background: #fdecec !important; border-color: #f5c2c2 !important; color: #7f1d1d !important; }
.alert-warning { background: #fff5e6 !important; border-color: #fbd9a5 !important; color: #7c4a03 !important; }
.alert-info { background: #e9f0fe !important; border-color: #bfd3fb !important; color: #1e3a8a !important; }
.alert .close, .alert a { color: inherit !important; }

.modal-content { border: 0; border-radius: var(--hw-radius) !important; box-shadow: var(--hw-shadow-lg); }
.modal-header { border-bottom: 1px solid var(--hw-border); border-radius: var(--hw-radius) var(--hw-radius) 0 0 !important; }
.modal-footer { border-top: 1px solid var(--hw-border); gap: 0.5rem; }
.modal-footer > * { margin: 0 !important; }
.dropdown-menu { border-radius: var(--hw-radius-sm); border-color: var(--hw-border); box-shadow: var(--hw-shadow-lg); font-size: 1rem; }
.dropdown-item { padding: 0.55rem 1rem; }
.page-link { min-width: var(--hw-touch); min-height: var(--hw-touch); display: flex; align-items: center; justify-content: center; }
.pagination { flex-wrap: wrap; gap: 4px; }
.page-item .page-link { border-radius: var(--hw-radius-sm) !important; }
.list-group-item { padding: 0.75rem 1rem; }

.main-footer { background: transparent; border-top: 1px solid var(--hw-border); color: var(--hw-muted); font-size: 0.85rem; }

/* ---------- Kopfzeile kompakt ---------- */
.hw-mobile-brand { color: var(--hw-text) !important; font-weight: 600; letter-spacing: .04em; font-size: 1.05rem; margin-right: auto; }
.hw-mobile-brand b { color: var(--hw-accent); }
.hw-pushmenu .nav-link { font-size: 1.25rem; padding: 0 0.9rem !important; }

/* ---------- Tablet / Handy ---------- */
@media (max-width: 991.98px) {
    .content-wrapper > .content { padding: 0 0.5rem; }
}

@media (max-width: 767.98px) {
    /* Kopfzeile: eine Zeile mit Menü-Knopf, ohne Suchfeld und Demo-Links */
    .main-header .navbar-toggler,
    .main-header .navbar-collapse { display: none !important; }
    .main-header .container-fluid { flex-wrap: nowrap !important; padding: 0 0.25rem; }
    .main-header { position: sticky; top: 0; }

    .content-header { padding: 12px 0.5rem 4px !important; }
    .content-header .breadcrumb { display: none; }
    h1, .h1 { font-size: 1.35rem !important; }
    .card-body { padding: 0.85rem !important; }
    .card-header { padding: 0.75rem 0.85rem !important; }
    .card-header .card-tools { float: none; margin: 0.4rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }

    /* breite Tabellen scrollen innerhalb der Karte statt die Seite zu verbreitern */
    .card .table, .content .table:not(.table-responsive .table) {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .btn-group { flex-wrap: wrap; }
    .btn-group:not(.btn-group-toggle) > .btn { flex: 1 1 auto; }
    .main-footer { display: none; }

    /* Dialoge auf dem Handy als Vollbild, Buttons unten erreichbar */
    .modal-dialog { margin: 0; max-width: none; min-height: 100%; }
    .modal-content { min-height: 100vh; min-height: 100dvh; border-radius: 0 !important; }
    .modal-header { border-radius: 0 !important; position: sticky; top: 0; z-index: 2; }
    .modal-footer {
        position: sticky; bottom: 0; z-index: 2;
        background: var(--hw-surface);
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
        flex-wrap: nowrap;
    }
    .modal-footer .btn { flex: 1 1 0; }
    .modal-footer .btn-success, .modal-footer .btn-primary { flex: 2 1 0; }
}

/* sehr kleine Displays (MDE ~ 360–480 px) */
@media (max-width: 480px) {
    html { font-size: 15.5px; }
    .content-wrapper > .content { padding: 0 0.25rem; }
    .row { margin-left: -6px; margin-right: -6px; }
    .row > [class*="col"] { padding-left: 6px; padding-right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ---------- Globale Suche in der Kopfzeile ---------- */
.hw-global-search { flex: 0 1 380px; margin-left: auto; margin-right: 0.5rem; }
.hw-global-search .form-control { border-radius: 999px 0 0 999px !important; background: var(--hw-surface-2); border-color: var(--hw-border); min-height: 40px; }
.hw-global-search .btn-navbar { border: 1px solid var(--hw-border); border-left: 0; border-radius: 0 999px 999px 0 !important; background: var(--hw-surface-2); min-width: 44px; }
.hw-global-search .form-control:focus { background: var(--hw-surface); }
.hw-mono { font-family: var(--hw-mono); }

/* ---------- Suchergebnisse ---------- */
.hw-search-hit { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.8rem; position: relative; }
.hw-search-hit .hw-mono { font-weight: 600; }
.hw-search-hit:hover { background: var(--hw-surface-2); }

/* ---------- Eigene Dialoge (HW.alert/HW.confirm) ---------- */
.hw-dialog .modal-content { border-radius: var(--hw-radius) !important; }
.hw-dialog .modal-body { font-size: 1.05rem; }
.hw-dialog .modal-footer .btn { min-width: 110px; min-height: var(--hw-touch); }

/* ---------- Untere Leiste (Handy/MDE) ---------- */
.hw-bottom-nav { display: none; }

@media (max-width: 767.98px) {
    .hw-global-search { display: none; }
    body.hw-search-open .hw-global-search {
        display: block; position: fixed; left: 0; right: 0; top: 0; z-index: 1040;
        margin: 0; padding: 8px; background: var(--hw-surface); box-shadow: var(--hw-shadow-lg); flex: none;
    }
    body.hw-search-open .hw-global-search .form-control { min-height: 48px; font-size: 1.05rem; }

    .hw-bottom-nav {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035;
        background: var(--hw-surface); border-top: 1px solid var(--hw-border);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -2px 10px rgba(16, 24, 40, 0.06);
    }
    .hw-bottom-nav a, .hw-bottom-nav button {
        flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 2px; min-height: 56px; border: 0; background: transparent; color: var(--hw-muted);
        font-size: 0.72rem; font-weight: 600; text-decoration: none; padding: 4px 0;
    }
    .hw-bottom-nav i { font-size: 1.25rem; }
    .hw-bottom-nav .active { color: var(--hw-accent); }
    .hw-bottom-nav a:active, .hw-bottom-nav button:active { background: var(--hw-surface-2); }
    .content-wrapper { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
    body.modal-open .hw-bottom-nav { display: none; }

    /* kleine Bestätigungsdialoge nicht im Vollbild */
    .hw-dialog .modal-dialog { margin: 1rem; min-height: calc(100% - 2rem); }
    .hw-dialog .modal-content { min-height: 0; }
    .hw-dialog .modal-footer { position: static; padding-bottom: 0.75rem; }
}

/* ---------- Geräteansicht: Kopf + Reiter ---------- */
.hw-dev-summary .card-body { padding: 1rem 1.25rem; }
.hw-sum-main { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; align-items: flex-start; }
.hw-sum-title { display: flex; gap: 0.8rem; align-items: flex-start; min-width: 0; }
.hw-sum-title > i { font-size: 1.6rem; color: var(--hw-muted); margin-top: 0.25rem; }
.hw-sum-title h2 { font-size: 1.3rem !important; margin: 0; font-weight: 700; }
.hw-sum-serial { font-family: var(--hw-mono); font-size: 1.35rem; font-weight: 700; letter-spacing: 0.02em; word-break: break-all; }
.hw-sum-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.hw-sum-badges .badge { font-size: 0.9rem; padding: 0.4em 0.7em; }
.hw-sum-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem 1rem; margin: 0.9rem 0 0; }
.hw-sum-facts dt { font-weight: 500; color: var(--hw-muted); font-size: 0.8rem; }
.hw-sum-facts dd { margin: 0; font-weight: 600; word-break: break-word; }
.hw-sum-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1rem; }
.hw-sum-actions .btn { min-height: var(--hw-touch); }

.hw-tabs { border-bottom: 1px solid var(--hw-border); margin-bottom: 0.75rem; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.hw-tabs .nav-link { white-space: nowrap; min-height: var(--hw-touch); display: flex; align-items: center; gap: 0.4rem; color: var(--hw-muted); border: 0; border-bottom: 3px solid transparent; font-weight: 600; }
.hw-tabs .nav-link.active { color: var(--hw-text); border-bottom-color: var(--hw-accent); background: transparent; }
.hw-device-view .tab-pane > .card:first-child { margin-top: 0; }

@media (max-width: 767.98px) {
    .hw-sum-serial { font-size: 1.15rem; }
    .hw-sum-facts { grid-template-columns: 1fr 1fr; }
    .hw-sum-actions .btn, .hw-sum-actions .btn-group { flex: 1 1 auto; }
}
.hw-device-view .hw-steps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 0.75rem; }
.hw-device-view .hw-step { font-size: 0.85rem; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--hw-surface-2); color: var(--hw-muted); border: 1px solid var(--hw-border); }
.hw-device-view .hw-step.done { background: #ecfdf3; color: #166534; border-color: #bbf7d0; }

/* ---------- Gespeicherte Ansichten (Listen) ---------- */
.hw-views { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -0.25rem 0 0.9rem; }
.hw-views-label { color: var(--hw-muted); font-size: 0.85rem; margin-right: 0.25rem; }
.hw-view { display: inline-flex; align-items: center; border: 1px solid var(--hw-border-strong); border-radius: 999px; background: var(--hw-surface); min-height: 36px; }
.hw-view a { padding: 0.25rem 0.75rem; color: var(--hw-text); font-size: 0.9rem; text-decoration: none; }
.hw-view button { border: 0; background: transparent; color: var(--hw-muted); padding: 0 0.6rem 0 0; font-size: 1.1rem; line-height: 1; }
.hw-view.active { background: var(--hw-accent-soft); border-color: var(--hw-accent); }
.hw-view.active a { color: var(--hw-accent-dark); font-weight: 600; }
.hw-view-save { display: inline-flex; gap: 4px; align-items: center; }
.hw-view-save input { width: 180px; }
.hw-cols { margin-left: auto; }
.hw-cols .dropdown-item { cursor: pointer; display: flex; gap: 0.5rem; align-items: center; }


/* Dashboard: Weiterarbeiten und Offen */
.hw-section-head { display: flex; align-items: baseline; justify-content: space-between; margin: .25rem 0 .6rem; }
.hw-section-head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.hw-section-head h2 i { color: var(--hw-accent); margin-right: .3rem; }
.hw-continue { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; margin-bottom: 1.25rem; }
.hw-continue-card { background: var(--hw-surface); border: 1px solid var(--hw-border); border-radius: 12px; padding: .85rem 1rem; display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.hw-continue-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.hw-continue-top small { color: var(--hw-muted); white-space: nowrap; }
.hw-continue-name { font-weight: 700; font-size: 1.05rem; color: var(--hw-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-continue-sub { color: var(--hw-muted); font-size: .85rem; min-height: 1.2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-continue-card .progress { height: 8px; border-radius: 999px; margin: .15rem 0 0; }
.hw-continue-stats { display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; }
.hw-continue-jtl { flex-wrap: wrap; }
.hw-jtl { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.hw-continue-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.hw-continue-actions .btn { flex: 1 1 auto; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
.hw-open { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 1.25rem; }
.hw-open a { background: var(--hw-surface); border: 1px solid var(--hw-border); border-radius: 12px; padding: .6rem .8rem; color: var(--hw-text); display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.hw-open a:hover, .hw-open a:focus { border-color: var(--hw-border-strong); text-decoration: none; }
.hw-open strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.hw-open span { color: var(--hw-muted); font-size: .85rem; }
.hw-open a.is-bad strong { color: var(--hw-accent-dark); }
.hw-dash-stats .info-box { min-height: 62px; padding: .35rem; margin-bottom: .6rem; }
.hw-dash-stats .info-box-icon { width: 44px; font-size: 1.1rem; }
@media (max-width: 575.98px) {
    .hw-open { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hw-open a { flex-direction: column; gap: 0; align-items: flex-start; }
    .hw-open span { font-size: .75rem; line-height: 1.15; }
}

/* Schnellanlage */
.hw-capture { max-width: 960px; margin: 0 auto; }
.hw-cap-head .card-body { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1rem; padding: .7rem 1rem; }
.hw-cap-batch { display: flex; align-items: center; gap: .5rem; flex: 1 1 280px; min-width: 0; }
.hw-cap-batch label { margin: 0; white-space: nowrap; font-weight: 600; }
.hw-cap-count { white-space: nowrap; color: var(--hw-muted); }
.hw-cap-count strong { font-size: 1.35rem; color: var(--hw-text); font-variant-numeric: tabular-nums; }
.hw-cap-keep { margin: 0; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; }
.hw-cap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1rem; }
#cap-fields:not(:empty) { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--hw-border); }
.hw-cap-field label { font-size: .85rem; margin-bottom: .15rem; font-weight: 600; }
.hw-req { color: var(--hw-accent-dark); }
.hw-cap-field .hw-cap-in:focus { box-shadow: 0 0 0 3px var(--hw-accent-soft); }
.hw-cap-hint { display: block; min-height: 1.2em; color: var(--hw-muted); }
.hw-cap-hint.ok { color: #198754; }
.hw-cap-hint.bad { color: var(--hw-accent-dark); font-weight: 600; }
.hw-cap-extra { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 40px; gap: .5rem; margin-top: .5rem; }
#cap-add-extra { margin-top: .6rem; min-height: 32px; }
.hw-cap-msg { margin-top: .75rem; padding: .55rem .75rem; border-radius: 8px; background: var(--hw-accent-soft); color: var(--hw-accent-dark); }
.hw-cap-wide { grid-column: 1 / -1; }
.hw-type-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.hw-type-chip { min-height: 44px; padding: 0 .9rem; border: 1px solid var(--hw-border-strong); border-radius: 10px; background: var(--hw-surface); color: var(--hw-text); font-weight: 600; text-transform: capitalize; }
.hw-type-chip:hover { border-color: var(--hw-accent); }
.hw-type-chip.active { background: var(--hw-accent); border-color: var(--hw-accent); color: #fff; }
.hw-type-box { position: relative; }
.hw-type-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; max-height: 300px; overflow-y: auto; background: var(--hw-surface); border: 1px solid var(--hw-border-strong); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }
.hw-type-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 44px; padding: 0 .75rem; border-radius: 7px; cursor: pointer; }
.hw-type-list li span { font-size: 1rem; text-transform: capitalize; }
.hw-type-list li small { color: var(--hw-muted); font-variant-numeric: tabular-nums; }
.hw-type-list li:hover, .hw-type-list li.active { background: var(--hw-surface-2); }
.hw-cap-with-btn { display: flex; gap: .4rem; }
.hw-cap-seconds { width: 4.2rem; }
.hw-cap-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; padding: .5rem .75rem; border: 1px solid var(--hw-accent-dark); border-radius: .375rem; }
.hw-cap-bulk span { flex: 1 1 12rem; font-weight: 600; }
.hw-cap-hot { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .75rem; }
.hw-cap-hot-label { font-weight: 600; color: var(--hw-accent-dark); }
.hw-cap-hot-chip { border: 1px solid var(--hw-border); border-radius: 1rem; padding: .1rem .6rem; background: var(--hw-surface, transparent); }
.hw-cap-known { border: 1px solid var(--hw-border); border-radius: .375rem; padding: .5rem .75rem; margin: .25rem 0 .75rem; }
.hw-cap-known > div + div { margin-top: .35rem; }
.hw-cap-known .hw-cap-thumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
.hw-cap-known .hw-cap-thumb { position: relative; width: 84px; height: 84px; border: 2px solid var(--hw-border); border-radius: .375rem; overflow: hidden; cursor: pointer; padding: 0; background: #fff; }
.hw-cap-known .hw-cap-thumb img { width: 100%; height: 100%; object-fit: contain; }
.hw-cap-known .hw-cap-thumb.on { border-color: #198754; }
.hw-cap-known .hw-cap-thumb.on::after { content: "\2713"; position: absolute; top: 2px; right: 4px; color: #198754; font-weight: 700; }
.hw-cap-known .hw-cap-thumb:not(.on) img { opacity: .4; }
.hw-cap-known-choice { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.hw-cap-trend-hot { color: var(--hw-accent-dark); font-weight: 600; }
.hw-cap-with-btn .form-control { min-width: 0; flex: 1; }
.hw-cap-with-btn .btn { white-space: nowrap; }
.hw-cap-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }
.hw-cap-foot-left { display: flex; flex-wrap: wrap; gap: .5rem; }
.hw-cap-foot #cap-save { margin-left: auto; }
.hw-cap-foot::before, .hw-cap-foot::after { display: none; }
.hw-cap-row { display: flex; justify-content: space-between; gap: .75rem; padding: .45rem .9rem; }
@media (max-width: 575.98px) {
    .hw-cap-grid { grid-template-columns: minmax(0, 1fr); }
    #cap-save { flex: 1; }
}

/* Schnellanlage: Laufwerke und Komponenten */
.hw-cap-parent { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem .9rem; margin-bottom: .75rem; border-radius: 10px; background: var(--hw-accent-soft); border: 1px solid var(--hw-border); }
#cap-drives-box { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--hw-border); }
#cap-drives-box h6 { font-weight: 700; margin-bottom: .4rem; }
.hw-cap-drive { display: grid; grid-template-columns: 70px 1fr 90px 90px 90px 1.3fr 130px 36px; gap: .4rem; margin-bottom: .4rem; }
.hw-cap-drive .form-control { padding-left: .45rem; padding-right: .3rem; min-width: 0; }
@media (max-width: 991.98px) {
    .hw-cap-drive { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-bottom: .5rem; border-bottom: 1px dashed var(--hw-border); }
}
.hw-cap-part { display: grid; grid-template-columns: 150px 1fr 1.4fr 1.3fr 64px 120px 36px; gap: .4rem; margin-bottom: .4rem; }
.hw-cap-part .form-control { padding-left: .45rem; padding-right: .3rem; min-width: 0; }
@media (max-width: 767.98px) {
    .hw-cap-part { grid-template-columns: repeat(2, minmax(0, 1fr)) 36px; padding-bottom: .5rem; border-bottom: 1px dashed var(--hw-border); }
    .hw-cap-part [data-p=modell], .hw-cap-part [data-p=serial] { grid-column: 1 / -1; }
}
.hw-pxe .list-group-item { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.hw-pxe .hw-pxe-runs { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.hw-cap-lic { display: grid; grid-template-columns: 125px 2fr 1fr 64px 1fr 36px; gap: .4rem; margin-bottom: .4rem; }
.hw-cap-lic .form-control { padding-left: .45rem; padding-right: .3rem; min-width: 0; }
@media (max-width: 767.98px) {
    .hw-cap-lic { grid-template-columns: repeat(2, minmax(0, 1fr)) 70px; padding-bottom: .5rem; border-bottom: 1px dashed var(--hw-border); }
    .hw-cap-lic [data-l=produkt] { grid-column: 2 / -1; }
    .hw-cap-lic [data-l=notiz] { grid-column: 1 / 3; }
}
.hw-drive-line { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .35rem 0; border-bottom: 1px solid var(--hw-border); }
.hw-drive-line:last-child { border-bottom: 0; }
.hw-drive-health { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.hw-life { display: inline-flex; align-items: center; gap: .3rem; }
.hw-life-bar { display: inline-block; width: 64px; height: 8px; border-radius: 4px; background: var(--hw-border); overflow: hidden; }
.hw-life-bar > span { display: block; height: 100%; }
.hw-drive-reason { flex-basis: 100%; }
.hw-smart { flex-basis: 100%; }
.hw-smart summary { cursor: pointer; font-size: .85rem; color: var(--hw-muted, #6c757d); }
.hw-smart table { font-size: .8rem; }
.hw-kv { display: grid; grid-template-columns: minmax(110px, 32%) minmax(0, 1fr); gap: .3rem .75rem; margin: 0; }
.hw-kv dt { font-weight: 500; color: var(--hw-muted); }
.hw-kv dd { margin: 0; word-break: break-word; }
.hw-kv-del { display: flex; justify-content: space-between; gap: .5rem; }
.hw-add { margin-top: .6rem; }
.hw-add summary { cursor: pointer; color: var(--hw-muted); font-size: .9rem; }
.hw-flow { list-style: none; margin: 0; padding: 0; }
.hw-flow li { display: flex; gap: .6rem; padding: .4rem 0; color: var(--hw-muted); }
.hw-flow li > i { margin-top: .25rem; font-size: .85rem; }
.hw-flow li > div { flex: 1; min-width: 0; }
.hw-flow li.done { color: var(--hw-text); }
.hw-flow li.done > i { color: #16a34a; }
.hw-flow li.current strong::after { content: " · aktuell"; font-weight: 400; color: var(--hw-muted); }
.hw-flow-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0 .5rem; }
.hw-flow-note { font-size: .9rem; color: var(--hw-muted); }
.hw-drive-line form { display: flex; gap: .35rem; margin: 0; }
