body { background: #f6f7f9; }
.navbar-brand { font-weight: 800; }
.card { border: 0; border-radius: 1rem; box-shadow: 0 4px 18px rgba(15,23,42,.06); }
.form-control, .form-select, .btn { border-radius: .75rem; }
.small-muted { color: #64748b; font-size: .875rem; }
.stat-value { font-size: 1.75rem; font-weight: 800; }
.badge-soft { background: #eef2ff; color: #3730a3; }
.badge-danger-soft { background: #fef2f2; color: #991b1b; }
.login-shell { min-height: 100vh; display: grid; place-items: center; }
.qty-input { max-width: 110px; }
.price-input { max-width: 140px; }
.price-matrix-scroll { max-height: calc(100vh - 235px); min-height: 320px; }
.price-matrix-table { min-width: 1050px; }
.price-matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8fafc;
    box-shadow: inset 0 -1px #dee2e6;
    white-space: nowrap;
}
.price-matrix-table .matrix-product-col {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    background: #fff;
}
.price-matrix-table .matrix-unit-col {
    position: sticky;
    left: 190px;
    z-index: 2;
    min-width: 155px;
    background: #fff;
}
.price-matrix-table thead .matrix-product-col,
.price-matrix-table thead .matrix-unit-col { z-index: 5; background: #f8fafc; }
.price-matrix-table tbody tr:hover .matrix-product-col,
.price-matrix-table tbody tr:hover .matrix-unit-col { background: #f8f9fa; }
.price-matrix-table .matrix-price-col { min-width: 155px; }
.matrix-price-input.is-price-changed {
    background: #fff7d6;
    border-color: #e0a800;
    box-shadow: 0 0 0 .15rem rgba(224,168,0,.14);
}
.price-matrix-toolbar {
    position: sticky;
    top: 0;
    z-index: 6;
    background: #fff;
}
.ubl-batch-toolbar {
    position: sticky;
    top: 72px;
    z-index: 7;
    border: 1px solid #c7d2fe;
}
.ubl-proposal-card {
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
    border: 1px solid transparent;
}
.ubl-proposal-card.is-selected {
    border-color: #4f46e5;
    background: #f8faff;
    box-shadow: 0 5px 22px rgba(79,70,229,.13);
}
.dashboard-order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: .85rem;
}
.dashboard-order-card {
    display: block;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: .9rem;
    color: #0f172a;
    text-decoration: none;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.dashboard-order-card:hover {
    color: #0f172a;
    border-color: #818cf8;
    box-shadow: 0 6px 18px rgba(79,70,229,.10);
    transform: translateY(-1px);
}
.order-unit-row.has-quantity { background: #f0fdf4; }
.order-mobile-entry { display: none; }
.mobile-order-line {
    padding: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 3px 12px rgba(15,23,42,.06);
}
.mobile-line-details {
    padding: .7rem .8rem;
    border-radius: .75rem;
    background: #f8fafc;
}
.order-submit-bar {
    position: sticky;
    bottom: 0;
    z-index: 8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 1rem -.5rem -.5rem;
    padding: .9rem 1rem;
    border: 1px solid #dbeafe;
    border-radius: .9rem;
    background: rgba(255,255,255,.96);
    box-shadow: 0 -5px 20px rgba(15,23,42,.09);
    backdrop-filter: blur(8px);
}
@media (max-width: 991.98px) {
    .price-matrix-table .matrix-product-col { width: 155px; min-width: 155px; max-width: 155px; }
    .price-matrix-table .matrix-unit-col { left: 155px; min-width: 135px; }
    .ubl-batch-toolbar { top: 64px; }
}
@media (max-width: 767.98px), (max-width: 932px) and (pointer: coarse) {
    main.container-fluid { padding-left: .75rem; padding-right: .75rem; }
    .dashboard-order-grid { grid-template-columns: 1fr; }
    .dashboard-order-card { min-height: 132px; }
    .order-create-shell { margin-left: -.25rem; margin-right: -.25rem; border-radius: .85rem; }
    .order-create-form .form-control,
    .order-create-form .form-select,
    .order-customer-loader .form-select,
    .order-customer-loader .btn {
        min-height: 46px;
        font-size: 16px;
    }
    .order-desktop-entry { display: none; }
    .order-mobile-entry { display: block; }
    #mobile-add-order-line { min-height: 46px; white-space: nowrap; }
    .mobile-order-line .mobile-qty-input {
        min-height: 52px;
        border-width: 2px;
        font-size: 1.15rem;
        font-weight: 700;
    }
    .order-submit-bar {
        bottom: 0;
        margin: 1rem -.75rem -.75rem;
        padding: .8rem .85rem calc(.8rem + env(safe-area-inset-bottom));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 0;
    }
    .order-submit-bar .btn { min-height: 48px; white-space: nowrap; }
}
@media (max-width: 430px) {
    .order-submit-bar { align-items: stretch; flex-direction: column; }
    .order-submit-bar .btn { width: 100%; }
}
