html, body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
}

:root {
    --app-bg: #f8f9fa;
    --app-surface: #ffffff;
    --app-border: #e0e0e0;
    --app-shadow: 0 0.5rem 1.25rem rgba(15, 23, 42, 0.08);
    --app-radius: 0.75rem;
    --app-radius-sm: 0.5rem;
    --app-text-muted: #6c757d;
    --app-sidebar-bg: #ffffff;
    --app-sidebar-text: #111827;
    --app-sidebar-muted: #4b5563;
    --app-sidebar-border: #e5e7eb;
    --app-sidebar-active: #111827;
    --app-sidebar-hover: #f3f4f6;
    --app-sidebar-icon: #0f172a;
}

body {
    background-color: var(--app-bg);
}

#blazor-error-ui {
    background: #ffebee;
    bottom: 0;
    display: none;
    left: 0;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .reload {
    color: #d32f2f;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #28a745;
}

.invalid {
    outline: 1px solid #dc3545;
}

.validation-message {
    color: #dc3545;
    font-size: 0.875em;
}

/* Main layout */
.content {
    min-height: calc(100vh - 50px);
    background-color: var(--app-bg);
}

.app-shell {
    min-height: 100vh;
    --app-sidebar-width: 260px;
    --app-sidebar-dock: 64px;
}

.app-main {
    min-height: 100vh;
    width: 100%;
    background-color: var(--app-bg);
    box-sizing: border-box;
    padding-left: 0;
    transition: padding-left 0.2s ease;
    max-width: 100%;
    margin-left: 0 !important
}

.app-shell > .app-main {
    transform: none !important;
}

.app-main.app-main-expanded {
    padding-left: var(--app-sidebar-width);
}

.app-main.app-main-collapsed {
    padding-left: var(--app-sidebar-dock);
}

/* Shared page structure */
.app-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.app-page-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-weight: 600;
}

.app-section {
    margin-bottom: 1.5rem;
}

.app-inline-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

/* Cards */
.card {
    box-shadow: var(--app-shadow);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
}

.card-header {
    background-color: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    border-top-left-radius: var(--app-radius);
    border-top-right-radius: var(--app-radius);
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    font-weight: 500;
}

/* Syncfusion component alignment */
.app-grid {
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    overflow: hidden;
}

.app-grid .e-gridheader,
.app-grid .e-gridcontent,
.app-grid .e-gridpager {
    border-color: var(--app-border);
}

.app-grid .e-rowdragdrop,
.app-grid .e-rowdragdropcell {
    cursor: grab;
}

.app-grid .e-rowdragdrop:active,
.app-grid .e-rowdragdropcell:active {
    cursor: grabbing;
}

.app-grid .category-drag-handle {
    cursor: grab;
}

.app-grid .category-drag-handle:active {
    cursor: grabbing;
}

.app-tree .e-list-item {
    padding: 0.25rem 0.5rem;
    cursor: grab;
}

.app-tree .app-tree-node {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.app-tree .app-tree-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    color: #9aa0a6;
    cursor: grab;
}

.app-tree .app-tree-handle:active {
    cursor: grabbing;
}

.app-tree .app-tree-text {
    display: inline-block;
}

.app-grid-row-info .e-rowcell {
    background-color: #e7f1ff;
}

.app-grid-row-success .e-rowcell {
    background-color: #d1e7dd;
}

.app-grid-row-danger .e-rowcell {
    background-color: #f8d7da;
}

.app-btn.e-btn {
    border-radius: var(--app-radius-sm);
    font-weight: 600;
}

.app-btn.e-btn.e-outline {
    border-width: 1px;
}

.app-dialog .e-dlg-content {
    padding: 1.5rem;
}

.app-dialog .e-dlg-header-content {
    border-bottom: 1px solid var(--app-border);
}

.app-dialog .e-footer-content {
    border-top: 1px solid var(--app-border);
}

.app-input .e-input-group,
.app-input .e-input-group.e-control-wrapper {
    border-radius: var(--app-radius-sm);
}

.app-input .e-input-group .e-input {
    border-radius: var(--app-radius-sm);
}

.app-input.is-invalid .e-input-group,
.app-input.is-invalid .e-input-group.e-control-wrapper {
    border-color: #dc3545;
}

/* Forms */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
}

/* Spinner animation */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Sticky table header */
.table thead.sticky-top th {
    background-color: #f8f9fa;
}

/* Code blocks */
code {
    background-color: #f8f9fa;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

/* Modal backdrop fix */
.modal.show {
    display: block;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
}

.modal-backdrop {
    z-index: 4990;
}

/* Top bar */
.top-bar {
    min-height: 50px;
}

/* ==============================================
   Mobile styles (merged from mobile.css)
   ============================================== */
/* ==============================================
   LBSA Assembly Creator - Mobile PWA Styles
   ============================================== */

/* Mobile viewport and base */
.mobile-viewport {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

/* Mobile header */
.mobile-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mobile-header-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.mobile-header-user {
    font-size: 0.875rem;
    opacity: 0.9;
}

.mobile-header-btn.e-btn {
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
    background: transparent;
    padding: 0.25rem 0.5rem;
}

.mobile-header-btn.e-btn:hover,
.mobile-header-btn.e-btn:focus {
    background: rgba(255, 255, 255, 0.15);
}

/* Mobile content area */
.mobile-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 5rem; /* Space for bottom nav */
}

/* Bottom navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-top: 1px solid #e0e0e0;
    padding: 0 0.25rem;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    padding: var(--nav-padding-y, 0.5rem) 0.25rem;
    min-width: 0;
    flex: 1 1 0;
    transition: color 0.2s;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: #0d6efd;
}

.mobile-nav-item i {
    font-size: var(--nav-icon-size, 1.5rem);
    margin-bottom: 0.25rem;
}

.mobile-nav-item span {
    font-size: var(--nav-label-size, 0.75rem);
    font-weight: 500;
    line-height: 1;
}

/* Floating action button */
.mobile-fab {
    position: fixed;
    right: 1rem;
    bottom: 5.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #0d6efd;
    color: #fff;
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.3);
    z-index: 1100;
}

.mobile-fab:hover {
    color: #fff;
}

.mobile-fab i {
    font-size: 1.25rem;
}

.mobile-fab.mobile-fab-active {
    background-color: #0b5ed7;
    box-shadow: 0 12px 24px rgba(11, 94, 215, 0.35);
}

.mobile-fab-stack {
    position: fixed;
    right: 1rem;
    bottom: 5.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1100;
    align-items: flex-end;
}

.mobile-fab-stack .mobile-fab {
    position: static;
}

.mobile-fab-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-fab-label {
    background: #ffffff;
    color: #495057;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}

.mobile-fab-secondary {
    background-color: #198754;
    box-shadow: 0 10px 20px rgba(25, 135, 84, 0.3);
}

.mobile-fab-secondary:hover {
    color: #fff;
}

/* Mobile cards */
.mobile-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
    overflow: hidden;
}

.mobile-card-header {
    padding: 0.875rem 1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.mobile-card-header.bg-warning {
    background-color: #fff3cd;
    color: #856404;
}

.mobile-card-header.bg-primary {
    background-color: #e7f1ff;
    color: #0d6efd;
}

.mobile-card-header.bg-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.mobile-card-header.bg-danger {
    background-color: #f8d7da;
    color: #842029;
}

.mobile-card-body {
    padding: 0;
}

/* List items within cards */
.mobile-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mobile-list-item:last-child {
    border-bottom: none;
}

.mobile-list-item:active {
    background-color: #f8f9fa;
}

.mobile-list-item-content {
   /* flex: 1;*/
    width: calc(100% - 63px);
    min-width: 0;
}

.mobile-list-item-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: #212529;
}

.mobile-list-item-subtitle {
    font-size: 0.8125rem;
    color: #6c757d;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mobile-list-item-action {
    margin-left: 1rem;
    flex-shrink: 0;
}

.mobile-start-template-item {
    justify-content: flex-start;
    gap: 0.75rem;
}

.mobile-start-template-item .mobile-list-item-content {
    flex: 1 1 auto;
    width: auto;
}

.mobile-start-template-item .mobile-list-item-action {
    margin-left: 0;
}

.mobile-start-template-thumb {
    position: relative;
    flex: 0 0 84px;
    width: 84px;
    height: 64px;
    border-radius: 10px;
    border: 1px solid #dde3ea;
    background: linear-gradient(180deg, #fbfcfd 0%, #f0f3f6 100%);
    overflow: hidden;
    align-self: center;
}

.mobile-start-template-placeholder,
.mobile-start-template-img {
    position: absolute;
    inset: 0;
}

.mobile-start-template-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa6b2;
    font-size: 1.4rem;
}

.mobile-start-template-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Item serial cards */
.mobile-item-serial-card {
    position: relative;
    align-items: flex-start;
    padding-right: 5.5rem;
}

.mobile-item-serial-card.mobile-item-disabled {
    opacity: 0.6;
}

.mobile-item-thumb {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 128px;
    height: 85%;
    border-radius: 10px;
    background-color: #f1f3f5;
    border: 1px solid #e3e6ea;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #6c757d;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.mobile-item-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mobile-thumb-hidden {
    opacity: 0;
}

.mobile-item-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.mobile-item-thumb-skeleton {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #edf0f3 0%, #f7f8fa 50%, #edf0f3 100%);
    background-size: 200% 100%;
    animation: mobile-thumb-shimmer 1.2s ease-in-out infinite;
}

@keyframes mobile-thumb-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.mobile-btn-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.mobile-btn-group .e-btn {
    width: 100%;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    min-height: 32px;
}

.mobile-icon-action-btn.e-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.4rem;
}

.mobile-icon-action-btn .bi {
    font-size: 0.95rem;
    line-height: 1;
}

.mobile-item-actions {
    margin-top: 0.75rem;
}

/* Mobile buttons - large touch targets */
.mobile-btn {
    min-height: 48px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-btn.e-btn {
    box-shadow: none;
}

.mobile-btn.e-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.mobile-btn-primary {
    background-color: #0d6efd;
    color: white;
}

.mobile-btn-primary:hover,
.mobile-btn-primary:active {
    background-color: #0a58ca;
}

.mobile-btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.mobile-btn-warning:hover,
.mobile-btn-warning:active {
    background-color: #ffca2c;
}

.mobile-btn-success {
    background-color: #198754;
    color: white;
}

.mobile-btn-success:hover,
.mobile-btn-success:active {
    background-color: #157347;
}

.mobile-btn-danger {
    background-color: #dc3545;
    color: white;
}

.mobile-btn-danger:hover,
.mobile-btn-danger:active {
    background-color: #bb2d3b;
}

.mobile-btn-outline {
    background-color: transparent;
    border: 2px solid #dee2e6;
    color: #495057;
}

.mobile-btn-outline:hover,
.mobile-btn-outline:active {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.mobile-btn-sm {
    min-height: 40px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: auto;
}

/* Mobile badge */
.mobile-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
}

.mobile-badge-primary {
    background-color: #e7f1ff;
    color: #0d6efd;
}

.mobile-badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.mobile-badge-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.mobile-badge-danger {
    background-color: #f8d7da;
    color: #842029;
}

.mobile-badge-info {
    background-color: #cff4fc;
    color: #055160;
}

/* Mobile input fields - larger for touch */
.mobile-input {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background-color: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mobile-input.e-input-group,
.mobile-input.e-input-group.e-control-wrapper {
    width: 100%;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background-color: white;
    padding: 0;
    box-shadow: none;
}

.mobile-input.e-input-group input.e-input,
.mobile-input.e-input-group.e-control-wrapper input.e-input {
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.mobile-input:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.mobile-input.e-input-group:focus-within,
.mobile-input.e-input-group.e-control-wrapper:focus-within {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.mobile-input::placeholder {
    color: #adb5bd;
}

.mobile-input.e-input-group input.e-input::placeholder,
.mobile-input.e-input-group.e-control-wrapper input.e-input::placeholder {
    color: #adb5bd;
}

.mobile-input-readonly {
    background-color: #f8f9fa;
}

.mobile-input-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
}

.mobile-input-group {
    margin-bottom: 1rem;
}

/* Mobile checkbox - larger touch target */
.mobile-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.mobile-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    accent-color: #0d6efd;
    flex-shrink: 0;
}

.mobile-checkbox-label {
    font-size: 1rem;
    color: #212529;
}

/* Section headers */
.mobile-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

.mobile-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Empty state */
.mobile-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #6c757d;
}

.mobile-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.mobile-empty-state p {
    margin: 0;
    font-size: 0.9375rem;
}

/* Loading spinner */
.mobile-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

/* Alerts */
.mobile-alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.mobile-alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.mobile-alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.mobile-alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.mobile-alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.mobile-alert-info {
    background-color: #cff4fc;
    color: #055160;
}

/* Step indicator for wizard */
.mobile-step-indicator {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    background: white;
    margin: -1rem -1rem 1rem -1rem;
    border-bottom: 1px solid #eee;
}

.mobile-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.mobile-step-pending {
    background-color: #e9ecef;
    color: #6c757d;
}

.mobile-step-current {
    background-color: #0d6efd;
    color: white;
}

.mobile-step-completed {
    background-color: #198754;
    color: white;
}

/* Stock level indicators */
.stock-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stock-indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.stock-critical {
    background-color: #dc3545;
}

.stock-low {
    background-color: #ffc107;
}

.stock-ok {
    background-color: #198754;
}

/* Modal/Wizard for mobile */
.mobile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.mobile-modal-content {
    background: white;
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: auto;
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.mobile-modal-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.mobile-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.mobile-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
}

.mobile-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.mobile-modal-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    background: white;
}

.mobile-modal-footer .mobile-btn {
    flex: 1;
}

/* Barcode scanner */
.barcode-scanner-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.barcode-scanner-target {
    width: 100%;
}

.barcode-scanner-video {
    width: 100%;
    border-radius: 8px;
    background: #000;
}

.barcode-scanner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 100px;
    border: 3px solid #0d6efd;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.barcode-input-with-scan {
    display: flex;
    gap: 0.5rem;
}

.barcode-input-with-scan .mobile-input {
    flex: 1;
}

.barcode-input-with-scan .scan-btn {
    width: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.25rem;
    cursor: pointer;
}

.mobile-modal-close.e-btn {
    padding: 0;
    box-shadow: none;
    border: none;
}

.barcode-input-with-scan .scan-btn.e-btn {
    min-height: 48px;
    padding: 0;
    box-shadow: none;
}

.mobile-assembly-overview {
    display: flex;
    gap: 0.9rem;
    align-items: stretch;
}

.mobile-assembly-overview-meta {
    flex: 1 1 auto;
    min-width: 0;
}

.mobile-assembly-overview-thumb {
    position: relative;
    flex: 0 0 120px;
    width: 120px;
    height: 96px;
    max-width: 42%;
    border-radius: 10px;
    border: 1px solid #dde3ea;
    background: linear-gradient(180deg, #fbfcfd 0%, #f0f3f6 100%);
    overflow: hidden;
}

.mobile-assembly-overview-placeholder,
.mobile-assembly-overview-img {
    position: absolute;
    inset: 0;
}

.mobile-assembly-overview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa6b2;
    font-size: 1.6rem;
}

.mobile-assembly-overview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Component table for mobile */
.mobile-component-list {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.mobile-component-item {
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-component-item:last-child {
    border-bottom: none;
}

.mobile-component-name {
    font-weight: 500;
}

.mobile-component-code {
    font-size: 0.75rem;
    color: #6c757d;
    font-family: monospace;
}

.mobile-component-qty {
    font-weight: 600;
    color: #0d6efd;
}

/* Pull to refresh indicator */
.pull-to-refresh {
    text-align: center;
    padding: 1rem;
    color: #6c757d;
    display: none;
}

.pull-to-refresh.visible {
    display: block;
}

/* Utility classes */
.mb-mobile-1 { margin-bottom: 0.5rem; }
.mb-mobile-2 { margin-bottom: 1rem; }
.mb-mobile-3 { margin-bottom: 1.5rem; }

.text-mobile-muted { color: #6c757d; }
.text-mobile-primary { color: #0d6efd; }
.text-mobile-success { color: #198754; }
.text-mobile-danger { color: #dc3545; }

.fw-mobile-bold { font-weight: 600; }

/* Login page mobile styles */
.mobile-login-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

.mobile-login-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.mobile-login-title {
    text-align: center;
    margin-bottom: 2rem;
}

.mobile-login-title i {
    font-size: 3rem;
    color: #0d6efd;
    margin-bottom: 0.5rem;
}

.mobile-login-title h1 {
    font-size: 1.5rem;
    margin: 0;
    color: #212529;
}

.mobile-login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

/* ==============================================
   Component styles (moved from .razor files)
   ============================================== */
/* NavMenu */
.app-shell .app-sidebar,
.app-shell .app-sidebar.e-sidebar,
.app-shell .app-sidebar .e-sidebar {
    background-color: var(--app-sidebar-bg);
    color: var(--app-sidebar-text);
    border-right: 1px solid var(--app-sidebar-border);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.app-sidebar .app-sidebar-header,
.app-sidebar-header {
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.75rem;
    flex-wrap: nowrap;
    white-space: nowrap;
    min-height: 56px;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--app-sidebar-border);
}

.app-sidebar .app-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--app-sidebar-text);
    white-space: nowrap;
    line-height: 1.1;
    flex: 0 0 auto;
}

.app-sidebar .app-brand i {
    font-size: 1.1rem;
}

.app-sidebar .app-sidebar-toggle,
.app-sidebar .app-sidebar-toggle.e-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: var(--app-sidebar-border);
    color: var(--app-sidebar-text);
    background: transparent;
    margin: 0;
    flex: 0 0 auto;
}

.app-sidebar .app-sidebar-toggle:hover,
.app-sidebar .app-sidebar-toggle:focus,
.app-sidebar .app-sidebar-toggle.e-btn:hover,
.app-sidebar .app-sidebar-toggle.e-btn:focus {
    background: var(--app-sidebar-hover);
}

.app-nav {
    padding: 0.5rem;
    color: var(--app-sidebar-text);
}

.app-nav-section {
    margin-bottom: 0.75rem;
}

.app-nav-section:last-child {
    margin-bottom: 0;
}

.app-nav-section-title {
    padding: 0.5rem 0.75rem 0.25rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--app-sidebar-muted);
    font-weight: 600;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--app-sidebar-text);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    font-weight: 500;
    font-size: 0.95rem;
    opacity: 1;
}

.app-nav-link:hover,
.app-nav-link:focus {
    background-color: var(--app-sidebar-hover);
    color: var(--app-sidebar-text);
}

.app-nav-link:hover .app-nav-icon,
.app-nav-link:focus .app-nav-icon {
    color: var(--app-sidebar-text);
}

.app-nav-link.active {
    background-color: var(--app-sidebar-active);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(17, 24, 39, 0.25);
}

.app-nav-icon {
    width: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: var(--app-sidebar-icon);
}

.app-nav-link.active .app-nav-icon {
    color: #ffffff;
}

.app-nav-link-highlight {
    color: #92400e;
}

.app-nav-link-highlight:hover,
.app-nav-link-highlight:focus {
    color: #111827;
}

.app-nav-link-highlight.active {
    color: #ffffff;
}

.app-sidebar-collapsed .app-brand-text,
.app-sidebar-collapsed .app-nav-label,
.app-sidebar-collapsed .app-nav-section-title {
    display: none;
}

.app-sidebar-collapsed .app-sidebar-header {
    padding: 0.75rem 0.9rem;
}

.app-sidebar-collapsed .app-nav-link {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.app-sidebar-collapsed .app-nav {
    padding: 0.5rem 0.25rem;
}

/* MonitorLayout */
    .monitor-layout {
        min-height: 100vh;
        height: 100vh;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

/* AssemblyAuditTrail */
    .audit-timeline {
        position: relative;
    }

    .audit-item {
        position: relative;
    }

    .audit-icon .badge {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .audit-content {
        border-bottom: 1px solid #eee;
        padding-bottom: 12px;
    }

    .audit-item:last-child .audit-content {
        border-bottom: none;
    }

/* Stock take */
.stocktake-pallets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.stocktake-pallet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #ced4da;
    background: #f8f9fa;
    font-size: 0.85rem;
}

.stocktake-pallet.pending {
    background: #f1f3f5;
    color: #6c757d;
    border-style: dashed;
}

.stocktake-pallet.filled {
    background: #e9f7ef;
    border-color: #b7e4c7;
    color: #1b4332;
    font-weight: 600;
}

.stocktake-count-details {
    margin-top: 10px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.stocktake-count-detail-header,
.stocktake-count-detail-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 6px 10px;
    font-size: 0.8rem;
}

.stocktake-count-detail-header {
    background: #f8f9fa;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.stocktake-count-detail-row + .stocktake-count-detail-row {
    border-top: 1px solid #eef2f6;
}

.stocktake-diff-positive {
    color: #0f5132;
    font-weight: 600;
}

.stocktake-diff-negative {
    color: #842029;
    font-weight: 600;
}

.stocktake-diff-zero {
    color: #0c5460;
    font-weight: 600;
}

.stocktake-selection-table {
    max-height: 420px;
    overflow-y: auto;
}

.app-inline-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1055;
    width: min(360px, 90vw);
}

.item-photo-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.item-serial-photo-column {
    width: 148px;
    min-width: 148px;
}

.item-photo-tile {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    justify-content: stretch;
    width: 120px;
    max-width: 120px;
    height: 90px;
    max-height: 90px;
    vertical-align: top;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #dbe4ee;
    background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.item-photo-fill {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
    flex: 1 1 auto;
}

.item-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 8px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.item-photo-placeholder i {
    font-size: 1.35rem;
}

.item-photo-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
}

.item-photo-tile:hover .item-photo-overlay,
.item-photo-tile:focus-within .item-photo-overlay,
.item-photo-overlay-visible {
    opacity: 1;
}

.item-photo-overlay-busy {
    background: rgba(15, 23, 42, 0.55);
    pointer-events: auto;
}

.item-photo-overlay-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transform: translateY(8px);
    transition: transform 0.18s ease;
}

.item-photo-tile:hover .item-photo-overlay-actions,
.item-photo-tile:focus-within .item-photo-overlay-actions,
.item-photo-overlay-visible .item-photo-overlay-actions {
    transform: translateY(0);
}

.item-photo-overlay-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
    pointer-events: auto;
}

.item-photo-overlay-action:hover {
    transform: translateY(-1px);
    background: #ffffff;
    color: #020617;
}

.item-photo-overlay-action-danger {
    color: #b42318;
}

.item-photo-preview-modal {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 240px;
    max-height: 76vh;
}

.item-photo-modal-image {
    display: block;
    max-width: 100%;
    max-height: 72vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    background: #f8fafc;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.item-photo-preview {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.validation-sheet-page {
    min-height: 100vh;
    background: #eef2f7;
    padding: 24px;
}

.validation-sheet-toolbar {
    max-width: 1100px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.validation-sheet-card {
    max-width: 1100px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    padding: 32px;
}

.validation-sheet-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.validation-sheet-kicker {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #0f5f97;
    margin-bottom: 8px;
}

.validation-sheet-title {
    margin: 0 0 10px;
    font-size: 2rem;
    font-weight: 700;
    color: #102a43;
}

.validation-sheet-meta {
    display: flex;
    gap: 18px;
    row-gap: 6px;
    flex-wrap: wrap;
    color: #486581;
    font-size: 0.95rem;
}

.validation-sheet-description {
    margin: 14px 0 0;
    color: #52606d;
}

.validation-sheet-summary {
    min-width: 210px;
    display: grid;
    gap: 10px;
}

.validation-sheet-summary-item {
    border: 1px solid #d9e2ec;
    border-radius: 14px;
    padding: 12px 14px;
    background: #f8fbff;
}

.validation-sheet-summary-item span {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #627d98;
    margin-bottom: 4px;
}

.validation-sheet-summary-item strong {
    font-size: 1.1rem;
    color: #102a43;
}

.validation-sheet-instructions {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-left: 4px solid #0f5f97;
    background: #f4f9ff;
    color: #334e68;
    font-size: 0.95rem;
}

.validation-sheet-table {
    margin-bottom: 24px;
}

.validation-sheet-table thead th {
    background: #eaf2fb;
    color: #102a43;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.validation-sheet-table td {
    vertical-align: middle;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.validation-sheet-count-cell {
    height: 52px;
    background: #ffffff;
}

.validation-sheet-footer {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px) minmax(240px, 2fr);
    gap: 16px;
}

.validation-sheet-signoff span {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #52606d;
    margin-bottom: 8px;
}

.validation-sheet-signoff div {
    min-height: 46px;
    border-bottom: 1px solid #9fb3c8;
}

@media (max-width: 768px) {
    .validation-sheet-page {
        padding: 12px;
    }

    .validation-sheet-card {
        padding: 20px;
        border-radius: 14px;
    }

    .validation-sheet-header {
        flex-direction: column;
    }

    .validation-sheet-summary {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .validation-sheet-footer {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    body {
        background: #ffffff !important;
    }

    .validation-sheet-page {
        min-height: auto;
        background: #ffffff;
        padding: 0;
    }

    .validation-sheet-card {
        max-width: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .validation-sheet-table {
        font-size: 0.92rem;
    }

    .validation-sheet-count-cell {
        height: 46px;
    }
}

