@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap');

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f2f5;
    font-family: 'Noto Sans SC', sans-serif;
}

.mobile-frame {
    width: 375px;
    height: 812px;
    background-color: #fff;
    border: 16px solid #111;
    border-radius: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 44px;
    background-color: #fff;
    color: #111;
    font-size: 14px;
    font-weight: 500;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.status-bar .time {
    font-weight: 600;
}

.status-bar .notch {
    width: 150px;
    height: 28px;
    background: #111;
    border-radius: 0 0 15px 15px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.status-icons i {
    margin-left: 6px;
}

.screen-content {
    flex: 1;
    padding-top: 44px; /* a space for status-bar */
    overflow-y: auto;
    background-image: url('https://images.unsplash.com/photo-1543909466-96a1523f2905?q=80&w=800');
    background-size: cover;
    background-position: center;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.screen-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(240, 248, 255, 0.9); /* Alice Blue with 90% opacity */
    z-index: 1;
}

.login-container {
    padding: 30px;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-grow: 1;
    position: relative;
    z-index: 2;
}

.welcome-section {
    text-align: center;
    margin-top: 50px;
    margin-bottom: 50px;
}

.welcome-section h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #003366;
}

.welcome-section p {
    font-size: 16px;
    color: #555;
}

.login-form {
    width: 100%;
    box-sizing: border-box;
}

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 18px;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    box-sizing: border-box;
    background-color: #fff;
    color: #333;
}

.input-group input::placeholder {
    color: #aaa;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: #4dabf7;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.login-btn:hover {
    background: #3c90e8;
}

.app-version {
    text-align: center;
    margin-top: auto;
    padding-bottom: 20px;
    color: #6c757d;
}

.app-version p {
    font-size: 12px;
}

/* Workbench Page Styles */
.screen-content-white {
    flex: 1;
    padding-top: 44px; /* a space for status-bar */
    overflow-y: auto;
    background-color: #f4f7fa;
    display: flex;
    flex-direction: column;
}

.header {
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
    box-shadow: none;
}

.header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.screen-content-white .content-body {
    padding: 15px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    text-align: center;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    border: 1px solid #eee;
    background-color: #fff;
    padding: 15px 5px;
}

.menu-group {
    margin-bottom: 20px;
    background-color: #fff;
    padding: 15px;
    border: 1px solid #eee;
}

.menu-group-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    padding-left: 5px;
}

.menu-item:nth-child(2n+1) {
    border-right: 1px solid #e9ecef;
}

.menu-item:hover {
    background-color: #f8f9fa;
}

.menu-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: white;
}

.menu-icon-wrapper i {
    font-size: 28px;
}

.menu-label {
    font-size: 14px;
    font-weight: 500;
}

/* Icon Background Colors */
.bg-inbound { background-color: #28a745; }
.bg-putaway { background-color: #17a2b8; }
.bg-pickdown { background-color: #ffc107; }
.bg-outbound { background-color: #dc3545; }
.bg-overview { background-color: #6f42c1; }
.bg-stocktake { background-color: #20c997; }

/* Tab Bar Styles */
.tab-bar {
    display: flex;
    background-color: #fff;
    border-top: 1px solid #e9ecef;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #888;
    font-size: 12px;
    transition: color 0.2s;
}

.tab-item i {
    font-size: 22px;
    margin-bottom: 4px;
}

.tab-item.active {
    color: #4dabf7;
}


/* Profile Page Styles */
.profile-content {
    padding: 20px;
}

.profile-card, .action-list {
    background-color: #fff;
    margin-bottom: 15px;
}

.profile-item, .action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    font-size: 15px;
    text-decoration: none;
    color: #333;
}

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

.profile-label {
    color: #333;
    font-weight: 500;
}

.profile-value {
    color: #666;
}

.action-item-right {
    display: flex;
    align-items: center;
    color: #888;
}

.version-info {
    margin-right: 8px;
}

.logout-button {
    justify-content: center;
    color: #dc3545;
    font-weight: 500;
}

/* Scan Inbound Page Styles */
.header.with-back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
}

.back-button {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #333;
    font-size: 24px;
    padding: 10px;
    text-decoration: none;
}

.header.with-back-button h3 {
    width: 100%;
    margin: 0;
}

.scan-form-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f4f7fa;
}

.form-group {
    margin-bottom: 15px;
}

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

.form-control {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border: 1px solid #ddd;
    background-color: #fff;
    box-sizing: border-box;
    border-radius: 0;
}

.barcode-section {
    margin-top: 20px;
}

.barcode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.barcode-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.clear-all-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 13px;
    cursor: pointer;
}

.barcode-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 260px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #ddd;
}

.barcode-item {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
}

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

.barcode-text {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #333;
}

.barcode-info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
}

.product-info {
    flex: 1;
    margin-right: 12px;
    min-width: 0;
}

.sku-row {
    margin-bottom: 6px;
}

.sku-text {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.size-qty-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.size-text {
    font-size: 12px;
    color: #6c757d;
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 20px;
    text-align: center;
}

.qty-value {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

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

.quantity-input {
    width: 50px;
    padding: 2px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    background-color: #fff;
}

.quantity-input:focus {
    outline: none;
    border-color: #4dabf7;
    box-shadow: 0 0 0 2px rgba(77, 171, 247, 0.2);
}

.delete-barcode-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 14px;
}

.scan-footer {
    display: flex;
    padding: 15px;
    background-color: #fff;
    border-top: 1px solid #e9ecef;
}

.scan-button, .submit-button {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    border-radius: 0;
}

.scan-button {
    background-color: #ffc107;
    color: #333;
    margin-right: 10px;
}

.scan-button i {
    margin-right: 8px;
}

.submit-button {
    background-color: #4dabf7;
    color: #fff;
}

.submit-button.full-width {
    width: 100%;
}

/* Scan Shelving Page Specifics */
.input-group-with-button {
    display: flex;
}

.input-group-with-button .form-control {
    border-right: none;
}

.scan-icon-button {
    width: 50px;
    border: 1px solid #ddd;
    border-left: none;
    background-color: #f8f9fa;
    cursor: pointer;
    font-size: 20px;
    color: #555;
    border-radius: 0;
}

.barcode-item-placeholder {
    padding: 20px;
    text-align: center;
    color: #aaa;
    font-style: italic;
}

/* Scan Outbound Page Specifics */
#order-details-section.hidden {
    display: none;
}

.order-details-header h4 {
    margin: 20px 0 10px;
    font-size: 16px;
    font-weight: 500;
}

.order-item-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #fff;
    border: 1px solid #ddd;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

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

.item-info .item-sku {
    display: block;
    font-size: 13px;
}

.item-info .item-barcode {
    display: block;
    color: #666;
    font-size: 13px;
    font-family: 'Courier New', Courier, monospace;
}

.item-qty-status {
    font-size: 13px;
    padding: 5px 10px;
}

.item-qty-status.in-progress {
    color: #ffc107; /* Yellow */
}

.item-qty-status.complete {
    color: #28a745; /* Green */
}

.item-qty-status.shipped {
    color: #0d6efd; /* Blue */
}

/* Tracking Group Styles */
.tracking-group {
    background-color: #fff;
    border: 1px solid #ddd;
    margin-top: 20px;
}

.tracking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f9fa;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
    transition: background-color 0.2s;
}

.tracking-header.active {
    background-color: #e0f7ff;
    border-bottom-color: #4dabf7;
}

.tracking-header.complete {
    background-color: #e6ffed;
}

.tracking-info {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.tracking-info i {
    margin-right: 10px;
    font-size: 18px;
    color: #555;
}

.tracking-status {
    font-size: 13px;
    color: #007bff;
}

.tracking-status i {
    color: #28a745;
    font-size: 20px;
}

.tracking-group .order-item-list {
    border: none;
}

/* Inventory Overview Page Styles */
.inventory-overview-content {
    padding: 0 15px 15px 15px;
    flex: 1;
    overflow-y: auto;
}

.search-bar {
    position: relative;
    margin: 15px 0;
}

.search-bar.with-scan-button {
    display: flex;
}

.search-bar input {
    width: 100%;
    padding: 10px 10px 10px 40px;
    border: 1px solid #ddd;
    background-color: #fff;
    box-sizing: border-box;
    font-size: 14px;
    border-radius: 4px;
}

.search-bar.with-scan-button input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    flex-grow: 1;
}

.search-bar .bi-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    z-index: 2;
}

.scan-button-for-search {
    padding: 0 12px;
    border: 1px solid #ddd;
    border-left: none;
    background-color: #f8f9fa;
    cursor: pointer;
    font-size: 20px;
    color: #555;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* New Tree Styles */
#inventory-tree {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

#inventory-tree .children-container {
    display: none;
    padding-left: 20px;
    border-top: 1px solid #e9ecef;
}

#inventory-tree .tree-node-stack.open > .children-container {
    display: block;
}

.tree-node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 10px;
    cursor: pointer;
    transition: background-color 0.1s;
}

.tree-node-stack:not(:last-child) > .tree-node-header {
    border-bottom: 1px solid #e9ecef;
}

.tree-node-stack.level-2:not(:last-child) > .tree-node-header {
     border-bottom: 1px dashed #e0e0e0;
}


.tree-node-header:hover {
    background-color: #f8f9fa;
}

.node-content {
    display: flex;
    align-items: center;
}

.toggle-icon {
    font-size: 12px;
    margin-right: 8px;
    transition: transform 0.2s ease;
    color: #555;
    width: 12px; /* for alignment */
}
.leaf-placeholder {
    width: 20px; /* toggle-icon width + margin */
}

.tree-node-stack.open > .tree-node-header .toggle-icon {
    transform: rotate(90deg);
}

.node-details {
    display: flex;
    flex-direction: column;
}

.node-label {
    font-size: 12px;
    color: #888;
}
.node-value {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.node-total {
    font-weight: 700;
    font-size: 16px;
    color: #003366;
    padding-right: 5px;
}

.tree-node-stack.level-3 .node-details,
.tree-node-stack.level-4 .node-details {
    flex-direction: row;
    align-items: baseline;
}
.tree-node-stack.level-3 .node-label,
.tree-node-stack.level-4 .node-label {
    margin-right: 5px;
}
.tree-node-stack.level-4 .node-value {
    font-weight: normal;
}

/* Record Query Menu & List Styles */
.simple-list-menu {
    background-color: #fff;
}

.simple-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    font-size: 15px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
}
.simple-list-item:hover {
    background-color: #f8f9fa;
}

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

.simple-list-item i {
    color: #888;
}

.record-list-content {
    flex-grow: 1;
    overflow-y: auto;
    background-color: #f4f5f7;
}

.record-card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-top: 15px;
}

.record-main-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
}

.record-barcode {
    font-weight: 700;
    font-size: 16px;
    font-family: 'Courier New', Courier, monospace;
}

.record-status {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
}

.status-unshelved { background-color: #ffc107; color: #333;}
.status-shelved { background-color: #28a745; }
.status-picked { background-color: #fd7e14; }
.status-shipped { background-color: #0d6efd; }

.record-details {
    padding: 10px 15px;
    font-size: 14px;
    color: #555;
}

.record-details p {
    margin: 0 0 5px;
}
.record-details p:last-child {
    margin-bottom: 0;
}
.record-details strong {
    color: #333;
}

.filter-controls {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

.filter-select {
    flex: 1;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f7f7f7;
    font-size: 14px;
    color: #333;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.record-list {
    padding: 15px;
    background-color: #f4f5f7;
    font-size: 12px;
    color: #666;
}

.no-results-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.hidden {
    display: none;
}

/* 扫描页面通用样式 */
.scan-page-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f4f7fa;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    max-height: 80%;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #888;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin: 0 0 15px 0;
    color: #666;
}

.tracking-info-display {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.tracking-info-display p {
    margin: 0;
    font-size: 14px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
}

.btn-secondary {
    padding: 8px 16px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    padding: 8px 16px;
    background-color: #4dabf7;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
} 