body {
    min-height: 100vh;
}

.auth-shell {
    background: #031733;
}

[data-bs-theme="dark"] .auth-shell {
    background: #070b12;
}

.auth-card {
    background: #102a4c;
}

[data-bs-theme="dark"] .auth-card {
    background: #111827;
}

.app-sidebar-shell {
    background: var(--bs-dark);
    color: var(--bs-white);
}

[data-bs-theme="dark"] .app-sidebar-shell {
    background: #0b1220;
}

.app-sidebar-link {
    color: var(--bs-white);
}

.app-sidebar-link:hover,
.app-sidebar-link:focus {
    color: var(--bs-white);
    background: rgba(255, 255, 255, .08);
}

[data-bs-theme="dark"] .shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .45) !important;
}

.container-fluid-lg {
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

@media (min-width: 992px) {
    .container-fluid-lg {
        padding: 0 var(--bs-gutter-x, .75rem);
    }
}

.sidebar-shell {
    width: 160px;
}

.table-fixed-actions {
    width: 132px;
}

.debug-alert pre {
    white-space: pre-wrap;
    margin-bottom: 0;
}

.app-navbar-brand {
    min-width: 0;
}

.app-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 34px;
    padding: 5px 7px;
    border-radius: var(--bs-border-radius);
    background: var(--bs-dark);
}

.app-brand-mark img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.production-flow-builder {
    color: var(--bs-body-color);
}

.production-flow-builder .alert-light {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

.flow-stage-list {
    display: grid;
    gap: .75rem;
}

.flow-stage {
    display: flex;
    gap: .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    padding: .75rem;
}

.flow-stage.is-disabled {
    opacity: .58;
    background: var(--bs-tertiary-bg);
}

.flow-stage-body {
    flex: 1 1 auto;
    min-width: 0;
}

.flow-drag-handle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    min-height: 2.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    cursor: grab;
    touch-action: none;
}

.flow-drag-handle:active {
    cursor: grabbing;
}

.flow-stage-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.flow-field-label {
    display: block;
    margin-bottom: .25rem;
    color: var(--bs-secondary-color);
    font-size: .78rem;
    font-weight: 600;
}

.sortable-ghost {
    opacity: .35;
    background: var(--bs-tertiary-bg);
}

.sortable-chosen {
    border-color: var(--bs-primary);
}

@media (max-width: 575.98px) {
    .flow-stage {
        flex-wrap: wrap;
    }

    .flow-drag-handle {
        width: 100%;
        min-height: 2.5rem;
    }

    .flow-stage-fields {
        grid-template-columns: 1fr;
    }
}

.production-status-dot {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--bs-body-color);
    font-size: .9rem;
}

.production-status-dot span {
    width: .7rem;
    height: .7rem;
    border-radius: 999px;
    display: inline-block;
    background: var(--bs-secondary-color);
}

.production-status-dot.is-success span {
    background: var(--bs-success);
}

.production-status-dot.is-warning span {
    background: var(--bs-warning);
}

.production-status-dot.is-danger span {
    background: var(--bs-danger);
}

.production-status-dot.is-flashing span,
.production-status-dot.is-danger span {
    animation: productionPulse 1.2s ease-in-out infinite;
}

.production-shell-card,
#production-dashboard-root .card,
#production-orders-table.card,
#production-stage-summary.card,
#production-attention-list.card,
#production-recent-activity.card,
#scheduled-work-list.card,
#unscheduled-orders-list.card,
#production-templates-list.card,
#production-completed-table.card {
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

.border-dashed {
    border: 1px dashed var(--bs-border-color) !important;
}

@keyframes productionPulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: .45;
        transform: scale(.92);
    }
}
