/* Apply the Bauer template to the Hub's existing pages and controls. */
.bauer-hub {
    --green: var(--bs-primary);
    --muted: var(--bs-text-muted);
    --bg: var(--bs-background);
    background: var(--bs-background);
    color: var(--bs-text);
    font-family: var(--bs-font-body);
    font-size: 14px;
    line-height: 1.5;
}
.bauer-hub .sidebar {
    width: min(300px, 86vw);
    padding: 18px 14px 16px;
    color: var(--bs-text);
    transform: translateX(-100%);
    visibility: hidden;
}
.bauer-hub .sidebar.open { transform: none; visibility: visible; }
.bauer-hub .sidebar nav { padding-bottom: 0; }
.bauer-hub .sidebar nav a {
    margin: 0;
    border-radius: var(--bs-radius-sm);
    color: var(--bs-text-muted);
    white-space: normal;
}
.bauer-hub .sidebar nav a b { color: inherit; flex: 0 0 22px; }
.bauer-hub .sidebar nav a:hover { background: var(--hover); color: var(--bs-text); }
.bauer-hub .sidebar nav a.active { background: var(--bs-primary); color: var(--accent-on); }
.bauer-hub .sidebar nav a span { display: inline; }
html[data-theme] .bauer-hub .hub-brand { background: transparent; padding: 8px; }
html[data-theme="light"] .bauer-hub .hub-brand img { filter: brightness(0); }
.bauer-hub .hub-brand img { display: block; width: 100%; height: auto; }
.bauer-hub .hub-bar { margin: 0; align-items: center; }
.bauer-hub .workspace-main { min-width: 0; }
.bauer-hub main { padding-bottom: 24px; }
.bauer-hub .page-heading { margin-bottom: 20px; }
.bauer-hub .page-heading .muted { margin-top: 6px; }
.bauer-hub .btn { border-radius: var(--bs-radius-sm); }
.bauer-hub .btn.primary { color: var(--accent-on); background: var(--bs-primary); }
.bauer-hub .btn.primary:hover { background: var(--bs-primary-hover); }
.bauer-hub .btn.ghost { border: 1px solid var(--bs-border); color: var(--bs-text); background: var(--subtle); }
.bauer-hub .btn.ghost:hover { background: var(--hover); }
.bauer-hub :is(.card, .kpi, .service-row, .appointment, .login-card) {
    background: var(--bs-surface);
    color: var(--bs-text);
    border-radius: var(--bs-radius-lg);
    box-shadow: none;
    border: 1px solid var(--bs-border);
}
.bauer-hub .appointment { border-left-width: 6px; }
.bauer-hub .kpi b { font-family: var(--bs-font-heading); letter-spacing: -.035em; }
.bauer-hub :is(.card h2, .card h3) { font-family: var(--bs-font-heading); }
.bauer-hub :is(table, thead, tbody, tr, td, th) { border-color: var(--bs-border); }
.bauer-hub thead, .bauer-hub th { color: var(--bs-text); background: var(--subtle); }
.bauer-hub td { color: var(--bs-text); }
.bauer-hub :is(input:not([type=checkbox],[type=radio],[type=submit],[type=hidden]), textarea, select) {
    background: var(--bs-background);
    color: var(--bs-text);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius-sm);
}
.bauer-hub :is(input[type=checkbox], input[type=radio]) { accent-color: var(--bs-primary); }
.bauer-hub .alert.success { background: var(--success-bg); color: var(--success); }
.bauer-hub .alert.error { background: var(--error-bg); color: var(--error); }
.bauer-hub .setting-note.warning { background: var(--warning-bg); color: var(--warning); }
.bauer-hub .public-link-box, .bauer-hub .print-actions {
    background: var(--subtle);
    border-color: var(--bs-border);
    color: var(--bs-text);
}
.bauer-hub.login-body { background: var(--bs-background); }
.bauer-hub .login-card .hub-brand { max-width: 240px; margin: 0 auto 20px; }
@media (min-width: 960px) {
    .bauer-hub .sidebar { width: 100%; transform: none; visibility: visible; }
}
@media print {
    .bauer-hub .sidebar, .bauer-hub .hub-bar, .bauer-hub .skip-link, .bauer-hub .scrim { display: none !important; }
    .bauer-hub .shell { display: block; }
    .bauer-hub, .bauer-hub .card, .bauer-hub .kpi, .bauer-hub td, .bauer-hub th {
        color: #000;
        background: #fff;
    }
}

@media screen {
    .bauer-hub main table {
        background: var(--bs-surface);
        color: var(--bs-text);
        border-radius: var(--bs-radius-md);
        overflow: visible;
    }

    .bauer-hub main :is(th, td) {
        color: var(--bs-text);
        border-bottom: 1px solid var(--bs-border);
        text-align: left;
        vertical-align: middle;
    }

    .bauer-hub main th {
        background: var(--subtle);
        font-weight: 650;
    }

    .bauer-hub main th a { color: inherit; }
    .bauer-hub main th a:hover { color: var(--bs-primary); }
    .bauer-hub main tbody td:nth-child(2) { max-width: none; overflow: visible; text-overflow: clip; }
    .bauer-hub main tbody tr:hover { background: var(--hover); }
    .bauer-hub main :is(.table-scroll, .card:has(> table)) { max-width: 100%; overflow-x: auto; }
    .bauer-hub main table :is(.btn, .badge) { white-space: nowrap; }
    .bauer-hub main .badge { background: var(--subtle); color: var(--bs-text); }

    .bauer-hub .calendar-month { overflow: auto; }
    .bauer-hub :is(.calendar-month-head, .calendar-month-grid) { min-width: 820px; }
    .bauer-hub :is(.calendar-month-head, .calendar-week-head, .calendar-time-head) {
        background: var(--subtle);
        color: var(--bs-text);
        border-color: var(--bs-border);
    }

    .bauer-hub .calendar-month-grid { background: var(--bs-border); }
    .bauer-hub :is(.calendar-day, .calendar-week-column) { background: var(--bs-surface); color: var(--bs-text); }
    .bauer-hub .calendar-day { padding-bottom: 42px; }
    .bauer-hub .calendar-day.outside { background: var(--bs-background); }
    .bauer-hub .calendar-day-top > a { color: var(--bs-text); }
    .bauer-hub .calendar-day.outside .calendar-day-top > a { color: var(--bs-text-muted); }
    .bauer-hub .calendar-day.today .calendar-day-top > a { background: var(--bs-primary); color: var(--accent-on); }
    .bauer-hub :is(.calendar-day-top > span, .calendar-times) { background: var(--subtle); color: var(--bs-text-muted); }
    .bauer-hub :is(.calendar-week-day-head, .calendar-week-column, .calendar-hour-line, .calendar-times) { border-color: var(--bs-border); }
    .bauer-hub :is(.calendar-week-day-head.today, .calendar-week-column.today) { background: var(--success-bg); }
    .bauer-hub .calendar-week-day-head.today strong { color: var(--success); }
    .bauer-hub .calendar-times, .bauer-hub .calendar-time-head { position: sticky; left: 0; z-index: 6; }
    .bauer-hub .calendar-week-event { z-index: 3; }
    .bauer-hub :is(.calendar-event, .calendar-week-event, .calendar-legend > span) {
        background: var(--subtle);
        color: var(--bs-text);
        border-top: 1px solid var(--bs-border);
        border-right: 1px solid var(--bs-border);
        border-bottom: 1px solid var(--bs-border);
    }

    .bauer-hub :is(.calendar-event, .calendar-week-event):hover { background: var(--hover); }
    .bauer-hub :is(.calendar-event small, .calendar-week-event small, .calendar-week-event em) { color: var(--bs-text-muted); }
    .bauer-hub .calendar-week-event :is(strong, span) { line-height: 1.15; }
    .bauer-hub .calendar-week-event { padding-block: 3px; }
    .bauer-hub .calendar-add {
        background: var(--subtle);
        color: var(--bs-text) !important;
        border: 1px solid var(--bs-border);
        opacity: 1;
    }

    .bauer-hub .calendar-add:hover { background: var(--bs-primary); color: var(--accent-on) !important; }
}

@media screen {
    .bauer-hub .order-protocol-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-block: 10px 14px;
    }

    .bauer-hub .order-protocol-actions .btn.secondary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding-inline: 16px;
        border: 1px solid var(--line-muted);
        color: var(--bs-text);
        background: var(--subtle);
    }

    .bauer-hub .order-protocol-actions .btn.secondary:hover { background: var(--hover); }

    .bauer-hub .module-tabs {
        background: var(--subtle);
        border: 1px solid var(--bs-border);
        border-radius: var(--bs-radius-md);
    }

    .bauer-hub .module-tabs :is(a, button) {
        background: transparent;
        color: var(--bs-text);
        border-radius: var(--bs-radius-sm);
        white-space: nowrap;
    }

    .bauer-hub .module-tabs :is(a, button):hover { background: var(--hover); color: var(--bs-text); }

    .bauer-hub .module-tabs :is(a, button).active {
        background: var(--bs-primary);
        color: var(--accent-on);
        box-shadow: none;
    }
}

@media screen {
    html[data-theme="dark"] .bauer-hub .btn.primary,
    html[data-theme="dark"] .bauer-hub .btn.primary:is(:hover, :focus-visible, :active) {
        color: #000;
    }

    .bauer-hub .orders-overview { display: grid; gap: 16px; }
    .bauer-hub .orders-overview-filter .section-title { flex-wrap: wrap; }
    .bauer-hub :is(.orders-overview-filter .section-title h2, .order-detail-header h2) { margin: 0; }

    .bauer-hub .order-search-panel {
        background: var(--bs-background);
        border-color: var(--bs-border);
        margin-top: 16px;
    }

    .bauer-hub .order-search-panel > summary { color: var(--bs-text); }
    .bauer-hub .order-search-panel[open] > summary { background: var(--subtle); border-color: var(--bs-border); }
    .bauer-hub .order-search-panel form { padding: 14px; }
    .bauer-hub .order-search-grid { gap: 12px 16px; }
    .bauer-hub .filter-active-badge { background: var(--success-bg); color: var(--success); }
    .bauer-hub .orders-overview .order-result-count { margin-top: 12px; color: var(--bs-text-muted); }

    .bauer-hub .orders-overview-results { border: 1px solid var(--bs-border); border-radius: var(--bs-radius-lg); }
    .bauer-hub .orders-overview-results table { min-width: 700px; }
    .bauer-hub .orders-overview-results :is(th, td) { padding: 10px 12px; }
    .bauer-hub .orders-overview-results tr:last-child td { border-bottom: 0; }

    .bauer-hub :is(.order-row-actions, .order-detail-actions) { display: flex; flex-wrap: wrap; gap: 8px; }
    .bauer-hub .order-detail-header { margin-bottom: 16px; }
}

@media screen {
    html[data-theme="dark"] .bauer-hub .quick-status .status-action-completed,
    html[data-theme="dark"] .bauer-hub .quick-status .status-action-completed:hover {
        color: #000;
    }

    .bauer-hub .order-detail .order-status-actions { margin: 0 0 16px; }
    .bauer-hub .order-detail .order-status-actions > strong { flex-basis: 100%; }
}

@media screen {
    html[data-theme="dark"] .bauer-hub .print-btn-label,
    html[data-theme="dark"] .bauer-hub .print-btn-label:is(:hover, :focus-visible, :active) {
        color: #000;
    }
}

@media screen {
    .bauer-hub .hub-bar .topbar-start,
    .bauer-hub .hub-bar .topbar-end { flex-wrap: wrap; }

    .bauer-hub main :is(.grid, .section-title, .actions, fieldset) { min-width: 0; }
    .bauer-hub main .grid > * { min-width: 0; }
    .bauer-hub main fieldset { border: 1px solid var(--bs-border); border-radius: var(--bs-radius-md); margin: 14px 0; padding: 14px; }
    .bauer-hub main fieldset legend { padding-inline: 5px; }
    .bauer-hub main fieldset .grid { margin-bottom: 10px; }
    .bauer-hub main input[type=file] { max-width: 100%; }

    .bauer-hub .order-search-query { grid-column: span 2; }
    .bauer-hub .ceramic-offer > form { margin-top: 16px; }
    .bauer-hub .ceramic-offer > :is(h3, hr) { margin-top: 20px; }
    .bauer-hub .ceramic-offer .grid { margin-bottom: 12px; }
    .bauer-hub .ceramic-offer form .grid:has(input[type=date]) { align-items: end; }

    @media (max-width: 900px) {
        .bauer-hub .order-search-query { grid-column: auto; }
    }

    @media (max-width: 420px) {
        .bauer-hub .hub-bar { padding-inline: 10px; gap: 6px; min-height: 59px; height: auto; }
        .bauer-hub .hub-bar .topbar-start,
        .bauer-hub .hub-bar .topbar-end { flex-wrap: nowrap; gap: 4px; }
        .bauer-hub .hub-bar .mobile-brand { width: clamp(68px, 22vw, 95px); padding: 2px; }
        .bauer-hub .hub-bar .breadcrumb { display: none; }
        .bauer-hub .hub-bar .btn { padding-inline: 7px; white-space: nowrap; font-size: 11px; }
    }
}

@media screen {
    .bauer-hub .sidebar nav .nav-link.active {
        background: var(--subtle);
        color: var(--bs-text);
        box-shadow: inset 3px 0 var(--bs-primary);
    }

    .bauer-hub .sidebar nav .nav-link.active b { color: var(--bs-primary); }
    .bauer-hub .ceramic-offer .section-title h2 { margin: 0; }
    .bauer-hub .ceramic-offer .grid > label,
    .bauer-hub .order-search-grid > label { margin-top: 0; }
}

@font-face {
    font-family: FontAwesome;
    src: url('../fonts/fontawesome-webfont.woff2') format('woff2');
    font-style: normal;
    font-weight: normal;
    font-display: block;
}

.bauer-hub .sidebar .hub-nav-icon {
    font: normal 16px/1 FontAwesome;
    text-align: center;
}
