/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.mobile-menu-toggle,
.mobile-menu-backdrop {
    display: none;
}

.logo h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.logo p {
    font-size: 12px;
    opacity: 0.9;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.role-badge {
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.btn-logout {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.1);
}

/* Main Layout */
.main-container {
    display: flex;
    flex: 1;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    border-bottom: 1px solid #e9ecef;
}

.sidebar li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar li a:hover {
    background: #f8f9fa;
    color: #667eea;
    padding-left: 25px;
}

.sidebar li.active a {
    background: #667eea;
    color: white;
    border-left: 4px solid #764ba2;
}

.sidebar li a i {
    margin-right: 10px;
    width: 20px;
}

.menu-section {
    padding: 10px 20px;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Content */
.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.page-header h2 {
    color: #495057;
    font-size: 24px;
}

.page-header h2 i {
    margin-right: 10px;
    color: #667eea;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn i {
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-secondary:hover {
    background: #dee2e6;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid #667eea;
    border-radius: 5px;
    background: #fff;
    color: #5969c4;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

.btn-outline:hover {
    background: #f1f3ff;
    color: #4657b5;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.autocomplete-field {
    width: 100%;
}

.autocomplete-add {
    margin-top: 8px;
}

.outline-select {
    position: relative;
}

.outline-select-source {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.outline-select-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.outline-choice {
    padding: 8px 13px;
    border: 1px solid #cbd2e0;
    border-radius: 6px;
    background: #fff;
    color: #495057;
    font: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.outline-choice:hover {
    border-color: #667eea;
    background: #f5f6ff;
}

.outline-choice[aria-pressed="true"] {
    border-color: #667eea;
    background: #eef0ff;
    color: #4657b5;
    box-shadow: inset 0 0 0 1px #667eea;
}

.outline-select-options[aria-invalid="true"] .outline-choice {
    border-color: #dc3545;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: white;
    font-size: 24px;
}

.stat-info h3 {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #495057;
    display: block;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.card h3 {
    color: #495057;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f8f9fa;
}

.stocktake-session-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.stocktake-session-heading h3 {
    margin-bottom: 8px;
}

.stocktake-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.stocktake-status.is-open {
    background: #fff3cd;
    color: #856404;
}

.stocktake-status.is-completed {
    background: #d4edda;
    color: #155724;
}

.stocktake-progress {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    color: #495057;
}

.stocktake-progress strong {
    color: #495057;
    font-size: 28px;
    line-height: 1.2;
}

.stocktake-scanner-controls {
    margin: 18px 0;
}

.stocktake-camera-toggle {
    min-height: 64px;
    min-width: min(100%, 320px);
    justify-content: center;
    font-size: 20px;
}

.stocktake-camera-video {
    display: block;
    width: min(100%, 520px);
    max-height: 60vh;
    margin-top: 15px;
    border-radius: 8px;
    background: #111;
}

.stocktake-manual-form,
.stocktake-create-form {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.stocktake-manual-form label,
.stocktake-create-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
}

.stocktake-manual-row {
    display: flex;
    gap: 8px;
    flex: 1;
}

.stocktake-manual-row input {
    flex: 1;
    min-width: 0;
}

.stocktake-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.stocktake-qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 12px;
}

.stocktake-qr-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #fff;
    transition: background-color 0.2s, border-color 0.2s;
}

.stocktake-qr-card.is-scanned {
    border-color: #28a745;
    background: #e8f7ec;
}

.stocktake-qr-image {
    flex: 0 0 112px;
    min-height: 112px;
}

.stocktake-qr-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.stocktake-qr-info code {
    font-size: 12px;
}

.stocktake-scan-state {
    color: #9a6700;
    font-weight: 600;
}

.stocktake-qr-card.is-scanned .stocktake-scan-state {
    color: #1e7e34;
}

.stocktake-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 20px;
}

.stocktake-pagination a {
    min-width: 38px;
    padding: 7px 10px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    color: #495057;
    text-align: center;
    text-decoration: none;
}

.stocktake-pagination a.is-current {
    border-color: #667eea;
    background: #667eea;
    color: #fff;
}

.stocktake-page-caption,
.stocktake-completed-at {
    margin-top: 12px;
    color: #6c757d;
}

.stocktake-note {
    margin: 18px 0;
    padding: 12px;
    border-left: 4px solid #667eea;
    background: #f8f9fa;
}

.stocktake-note p {
    margin-top: 6px;
}

.stocktake-finish-form {
    display: grid;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.stocktake-finish-form textarea {
    width: 100%;
}

.stocktake-finish-form .btn {
    justify-self: start;
}

.stocktake-unknown-list {
    margin-top: 20px;
}

.stocktake-unknown-list ul {
    padding: 12px 0 0 24px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background 0.3s;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table td {
    padding: 12px 15px;
    font-size: 14px;
}

.data-table .text-right {
    text-align: right;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

.badge-primary {
    background: #cce5ff;
    color: #004085;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Forms */
.filter-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.filter-form .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    font-size: 14px;
    transition: border 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

[hidden] {
    display: none !important;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Activity List */
.activity-list {
    margin-top: 20px;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: #667eea;
}

.activity-content p {
    margin-bottom: 5px;
    font-weight: 500;
}

.activity-content small {
    color: #6c757d;
    font-size: 12px;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

.footer-section h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section p {
    margin-bottom: 10px;
    opacity: 0.8;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    opacity: 0.7;
}

/* Progress Bar */
.progress {
    height: 20px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
}

/* Action Buttons */
.actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    text-decoration: none;
    color: white;
    font-size: 14px;
}

.btn-icon.view {
    background: #3498db;
}

.btn-icon.edit {
    background: #f39c12;
}

.btn-icon.delete {
    background: #e74c3c;
}

/* Responsive */
@media (max-width: 768px) {
    .stocktake-session-heading {
        flex-direction: column;
    }

    .stocktake-progress {
        align-items: flex-start;
    }

    .stocktake-camera-toggle {
        width: 100%;
    }

    .stocktake-manual-form {
        align-items: stretch;
        flex-direction: column;
    }

    .stocktake-manual-row {
        width: 100%;
    }

    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1001;
        width: min(300px, 85vw);
        border: none;
        box-shadow: 4px 0 18px rgba(0, 0, 0, 0.18);
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    .mobile-menu-toggle {
        position: relative;
        z-index: 1002;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        border: 1px solid rgba(255, 255, 255, 0.55);
        border-radius: 6px;
        background: transparent;
        color: white;
        font-size: 20px;
        cursor: pointer;
    }

    .mobile-menu-backdrop:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1000;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(20, 28, 40, 0.48);
    }

    .header {
        gap: 12px;
        padding: 12px 16px;
    }

    .logo {
        flex: 1;
        min-width: 0;
    }

    .logo h1 {
        font-size: 19px;
    }

    .logo p {
        font-size: 10px;
    }

    .user-info {
        gap: 6px;
        font-size: 12px;
    }

    .user-info > span:first-child {
        display: none;
    }

    .user-info .role-badge {
        padding: 3px 7px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Purchase order items */
.purchase-items {
    display: grid;
    gap: 14px;
}

.purchase-item {
    min-width: 0;
    padding: 18px;
    border: 1px solid #e1e6ef;
    border-radius: 10px;
    background: #fbfcff;
}

.purchase-item-heading {
    display: grid;
    grid-template-columns: minmax(260px, 2.6fr) minmax(110px, 0.8fr) minmax(170px, 1.2fr) minmax(130px, 1fr) 40px;
    align-items: end;
    gap: 14px;
}

.purchase-item-primary,
.purchase-item-quantity,
.purchase-item-weight,
.purchase-dimension-field {
    min-width: 0;
}

.purchase-item label {
    display: block;
    margin-bottom: 6px;
    color: #495057;
    font-size: 13px;
    font-weight: 600;
}

.purchase-item input,
.purchase-item select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid #d8deea;
    border-radius: 6px;
    background: #fff;
    color: #343a40;
    font: inherit;
}

.purchase-item input:focus,
.purchase-item select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.purchase-item input:disabled {
    background: #f0f2f6;
    color: #89909b;
}

.purchase-item-total {
    min-height: 42px;
    padding: 0 10px 7px;
    border-left: 3px solid #667eea;
}

.purchase-item-total span,
.purchase-item-total strong {
    display: block;
}

.purchase-item-total span {
    margin-bottom: 4px;
    color: #6c757d;
    font-size: 12px;
}

.purchase-item-total strong {
    color: #343a40;
    font-size: 16px;
}

.purchase-item .remove-item {
    width: 40px;
    height: 42px;
    padding: 0;
}

.purchase-item-dimensions {
    display: grid;
    grid-template-columns: repeat(5, minmax(100px, 1fr));
    gap: 14px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e8ebf1;
}

.purchase-item-dimensions [hidden] {
    display: none;
}

.purchase-add-item {
    margin-top: 14px;
}

@media (max-width: 1050px) {
    .purchase-item-heading {
        grid-template-columns: minmax(220px, 2fr) minmax(100px, 0.8fr) minmax(145px, 1.2fr) minmax(120px, 1fr) 40px;
        gap: 10px;
    }

    .purchase-item-dimensions {
        grid-template-columns: repeat(3, minmax(100px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .purchase-item {
        padding: 14px;
    }

    .purchase-item-heading {
        grid-template-columns: minmax(0, 1fr) minmax(95px, 0.45fr);
        gap: 12px;
    }

    .purchase-item-primary {
        grid-column: 1 / -1;
    }

    .purchase-item-total {
        align-self: center;
        padding-bottom: 0;
    }

    .purchase-item .remove-item {
        justify-self: end;
    }

    .purchase-item-dimensions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

/* Sales order items */
.sales-order-items {
    display: grid;
    gap: 14px;
}

.sales-order-item {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: end;
    gap: 10px;
    min-width: 0;
    padding: 18px;
    border: 1px solid #e1e6ef;
    border-radius: 10px;
    background: #fbfcff;
}

.so-item-main {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(250px, 2.5fr) minmax(90px, 0.65fr) minmax(120px, 0.85fr) minmax(125px, 0.9fr) 40px;
    align-items: end;
    gap: 14px;
}

.so-item-field {
    min-width: 0;
}

.so-item-field label,
.so-item-type > span:first-child {
    display: block;
    margin-bottom: 6px;
    color: #495057;
    font-size: 13px;
    font-weight: 600;
}

.sales-order-item input,
.sales-order-item select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid #d8deea;
    border-radius: 6px;
    background: #fff;
    color: #343a40;
    font: inherit;
}

.sales-order-item input:focus,
.sales-order-item select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.sales-order-item input[readonly] {
    background: #f1f3f8;
    color: #495057;
}

.selected-product-stock {
    margin: 10px 0 14px;
    padding: 12px 14px;
    border: 1px solid #d8deea;
    border-radius: 8px;
    background: #f8f9fc;
}

.selected-product-stock > strong {
    display: block;
    margin-bottom: 8px;
    color: #343a40;
}

.selected-product-stock dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 14px;
    margin: 0;
}

.selected-product-stock dt {
    color: #6c757d;
    font-size: 12px;
}

.selected-product-stock dd {
    margin: 2px 0 0;
    color: #343a40;
    font-weight: 600;
}

.so-item-type {
    min-width: 0;
}

.so-item-type .badge {
    min-height: 22px;
}

.so-item-weight,
.so-item-subtotal {
    min-height: 42px;
    padding: 0 10px 7px;
    border-left: 3px solid #667eea;
}

.so-item-weight span,
.so-item-weight strong,
.so-item-subtotal span,
.so-item-subtotal strong {
    display: block;
}

.so-item-weight span,
.so-item-subtotal span {
    margin-bottom: 4px;
    color: #6c757d;
    font-size: 12px;
}

.so-item-weight strong,
.so-item-subtotal strong {
    color: #343a40;
    font-size: 16px;
}

.sales-order-item .so-item-remove {
    width: 40px;
    height: 42px;
    /* padding: 0; */
}

.so-item-dimensions {
    display: contents;
}

.so-item-pricing {
    display: contents;
}

.so-item-price .price-label {
    color: #6c757d;
    font-size: 11px;
    font-weight: 400;
}

.so-item-subtotal {
    align-self: end;
}

.sales-order-item [hidden] {
    display: none;
}

.sales-order-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #e1e6ef;
    border-radius: 8px;
    background: #f8f9fc;
}

.sales-order-summary > div {
    min-width: 0;
}

.sales-order-summary span,
.sales-order-summary strong {
    display: block;
}

.sales-order-summary span {
    margin-bottom: 5px;
    color: #6c757d;
    font-size: 12px;
}

.sales-order-summary strong {
    color: #343a40;
    font-size: 15px;
}

.sales-order-summary .sales-order-summary-total {
    padding-left: 14px;
    border-left: 3px solid #667eea;
}

.sales-order-summary-total strong {
    color: #4d5dc1;
    font-size: 18px;
}

@media (max-width: 1050px) {
    .so-item-main {
        grid-template-columns: minmax(210px, 2fr) minmax(85px, 0.7fr) minmax(110px, 0.9fr) minmax(115px, 0.9fr) 40px;
        gap: 10px;
    }

    .sales-order-summary {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
}

@media (max-width: 768px) {
    .selected-product-stock dl {
        grid-template-columns: 1fr;
    }

    .sales-order-item {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 14px;
    }

    .so-item-main {
        grid-column: 1 / -1;
        grid-template-columns: minmax(0, 1fr) minmax(90px, 0.45fr);
        gap: 12px;
    }

    .so-item-product {
        grid-column: 1 / -1;
    }

    .so-item-type {
        grid-column: 1;
    }

    .so-item-weight {
        align-self: center;
        padding-bottom: 0;
    }

    .sales-order-item .so-item-remove {
        justify-self: end;
    }

    .so-item-dimensions {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid #e8ebf1;
    }

    .so-item-pricing {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .so-item-subtotal {
        align-self: center;
        padding-bottom: 0;
    }

    .sales-order-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sales-order-summary .sales-order-summary-total {
        padding-left: 0;
        border-left: 0;
    }
}