/* Solario24 Warehouse Pickup - Mobile-Optimized Styles (v4) */

:root {
    --green: #82bc42;
    --green-dark: #6a9e35;
    --green-light: #a8d970;
    --dark: #1e1e1e;
    --dark-light: #2d2d2d;
    --gray: #6b7280;
    --gray-light: #e5e7eb;
    --gray-lighter: #f3f4f6;
    --white: #ffffff;
    --red: #dc3545;
    --red-light: #fef2f2;
    --yellow: #efc436;
    --orange: #f97316;
    --blue: #3b82f6;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    color: var(--dark);
    background: var(--gray-lighter);
    overscroll-behavior: none;
}

/* App Container */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Global Scanner Input (hidden but focusable) */
.global-scan-input {
    position: absolute;
    top: -100px;
    left: -100px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Header */
.app-header {
    background: var(--dark);
    color: var(--white);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.app-header .logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.app-header h1 {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.header-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:active {
    background: rgba(255,255,255,0.1);
}

.back-btn {
    font-size: 24px;
}

/* Scan Indicator */
.scan-indicator {
    font-size: 20px;
    opacity: 0.5;
    transition: opacity 0.3s;
    min-width: 32px;
    text-align: center;
}

.scan-indicator.active {
    opacity: 1;
    color: var(--green);
}

/* Screen Container */
.screen {
    flex: 1;
    padding: 16px;
    display: none;
    animation: fadeIn 0.2s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.card-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Pickup List Items */
.pickup-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-left: 4px solid var(--green);
    transition: transform 0.1s;
}

.pickup-item:active {
    transform: scale(0.98);
}

.pickup-item.status-picked_up {
    border-left-color: var(--gray);
    opacity: 0.6;
}

.pickup-info {
    flex: 1;
    min-width: 0;
}

.pickup-name {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pickup-meta {
    font-size: 13px;
    color: var(--gray);
    margin-top: 4px;
}

.pickup-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--green);
    white-space: nowrap;
}

.pickup-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray);
    white-space: nowrap;
}

.pickup-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    text-align: right;
    margin-top: 4px;
}

.pickup-status.confirmed {
    background: #dcfce7;
    color: #166534;
}

.pickup-status.picked_up {
    background: var(--gray-light);
    color: var(--gray);
}

/* Swipe-to-Delete */
.swipe-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.swipe-delete-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100px;
    background: var(--red);
    color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.swipe-delete-bg .delete-icon {
    font-size: 22px;
}

.swipe-container .pickup-item {
    margin-bottom: 0;
    position: relative;
    z-index: 1;
    background: var(--white);
    will-change: transform;
}

.swipe-container .pickup-item.swiping {
    transition: none;
}

.swipe-container .pickup-item.snap-back {
    transition: transform 0.25s ease;
}

/* Swipe-to-Confirm (Incoming Goods) */
.ig-swipe {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 2px;
}

.swipe-confirm-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100px;
    background: var(--green);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.swipe-confirm-bg .confirm-icon {
    font-size: 22px;
}

.ig-swipe .ig-item {
    position: relative;
    z-index: 1;
    background: var(--white);
    will-change: transform;
}

.ig-swipe .ig-item.swiping {
    transition: none;
}

.ig-swipe .ig-item.snap-back {
    transition: transform 0.25s ease;
}

/* Weclapp-only items in open tab */
.pickup-item.weclapp-only {
    border-left-style: dashed;
    border-left-color: var(--blue);
}

/* Age-colored left border */
.pickup-item.border-warning {
    border-left-color: var(--orange);
}

.pickup-item.border-danger {
    border-left-color: var(--red);
}

.pickup-item.border-today {
    border-left-color: var(--blue);
    border-left-width: 4px;
}

.section-divider {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 4px 8px;
}

/* Shipment Age (Versand list) */
.shipment-age {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    text-align: right;
    margin-top: 4px;
    background: var(--gray-lighter);
    color: var(--gray);
}

.shipment-age.age-warning {
    background: #fff3cd;
    color: #92400e;
}

.shipment-age.age-danger {
    background: #fef2f2;
    color: var(--red);
}

/* Search Bar */
.search-bar {
    padding: 0 0 12px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    background: var(--white);
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.search-input:focus {
    border-color: var(--green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(130, 188, 66, 0.15);
}

.search-input::placeholder {
    color: var(--gray);
    opacity: 0.6;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 16px;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    min-height: 52px;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--green);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--green-dark);
}

.btn-primary:disabled {
    background: var(--gray-light);
    color: var(--gray);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--gray-lighter);
    color: var(--dark);
}

.btn-danger {
    background: var(--red);
    color: var(--white);
}

.detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.detail-actions .btn-primary {
    flex: 1;
}

.btn-print {
    white-space: nowrap;
    padding: 12px 16px;
}

.btn-sm {
    padding: 10px 16px;
    font-size: 14px;
    min-height: 44px;
}

/* Resend code button */
.btn-resend {
    background: none;
    border: 2px solid var(--gray-light);
    color: var(--gray);
    font-size: 13px;
    font-weight: 500;
    padding: 10px 16px;
    margin-top: 12px;
    min-height: 44px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.btn-resend:active {
    border-color: var(--green);
    color: var(--green);
}

.btn-resend:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Details Screen */
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-lighter);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--gray);
    font-size: 14px;
}

.detail-value {
    font-weight: 600;
    font-size: 14px;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

/* Items List */
.item-row {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-lighter);
    align-items: flex-start;
}

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

.item-qty {
    font-weight: 600;
    font-size: 14px;
    color: var(--green);
    white-space: nowrap;
    min-width: 36px;
    flex-shrink: 0;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 14px;
    word-break: break-word;
}

.item-sku {
    font-size: 11px;
    color: var(--gray);
    margin-top: 2px;
    font-family: 'Courier New', monospace;
}

/* Verify Screen - Numpad */
.code-display {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 24px 0;
}

.code-digit {
    width: 48px;
    height: 56px;
    border: 2px solid var(--gray-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    background: var(--white);
    transition: border-color 0.2s;
}

.code-digit.filled {
    border-color: var(--green);
    background: #f0faf0;
}

.code-digit.active {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(130, 188, 66, 0.2);
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 320px;
    margin: 24px auto 0;
}

.numpad-btn {
    height: 64px;
    font-size: 28px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: var(--white);
    color: var(--dark);
    cursor: pointer;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
}

.numpad-btn:active {
    background: var(--gray-lighter);
}

.numpad-btn.delete {
    background: var(--red-light);
    color: var(--red);
    font-size: 22px;
}

.numpad-btn.confirm {
    background: var(--green);
    color: var(--white);
    font-size: 22px;
}

.numpad-btn.confirm:disabled {
    background: var(--gray-light);
    color: var(--gray);
}

/* Skip Code Link (subtle, small - exception only) */
.skip-code-link {
    text-align: center;
    margin-top: 16px;
}

.skip-code-link a {
    font-size: 11px;
    color: var(--gray);
    text-decoration: none;
    opacity: 0.6;
}

.skip-code-link a:active {
    opacity: 1;
}

/* Serial Number Scanning */
.serial-scan-area {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.serial-input {
    flex: 1;
    padding: 14px 16px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    transition: border-color 0.2s;
    background: var(--white);
}

.serial-input:focus {
    border-color: var(--green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(130, 188, 66, 0.15);
}

.serial-add-btn {
    width: 52px;
    min-height: 52px;
    font-size: 24px !important;
    padding: 0 !important;
    flex-shrink: 0;
}

.serial-list {
    max-height: 240px;
    overflow-y: auto;
}

.serial-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f0faf0;
    border-radius: 8px;
    margin-bottom: 6px;
    border: 1px solid rgba(130, 188, 66, 0.2);
}

.serial-number {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.serial-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(220, 53, 69, 0.1);
    color: var(--red);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 8px;
}

.serial-remove:active {
    background: rgba(220, 53, 69, 0.2);
}

/* Photos (fallback) */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0;
}

.photo-thumb {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: var(--gray-lighter);
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-add {
    aspect-ratio: 1;
    border: 2px dashed var(--gray-light);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray);
    font-size: 14px;
    gap: 4px;
    transition: border-color 0.2s;
}

.photo-add:active {
    border-color: var(--green);
    color: var(--green);
}

.photo-add .plus {
    font-size: 32px;
    font-weight: 300;
}

/* Processing Overlay */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.processing-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    margin: 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
}

.progress-list {
    margin: 0;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-lighter);
}

.progress-step:last-child {
    border-bottom: none;
}

.step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.step-icon.pending {
    background: var(--gray-lighter);
    color: var(--gray);
}

.step-icon.active {
    background: #dbeafe;
    color: var(--blue);
    animation: pulse 1s infinite;
}

.step-icon.done {
    background: #dcfce7;
    color: #166534;
}

.step-icon.error {
    background: var(--red-light);
    color: var(--red);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.step-label {
    font-size: 15px;
    flex: 1;
}

.step-label.active {
    font-weight: 600;
}

/* ==================== RESEND SECTION (verify screen) ==================== */

.resend-section {
    margin-top: 24px;
    padding: 16px;
}

/* ==================== SIGNATURE FULLSCREEN OVERLAY (v4.3) ==================== */

/* Full-screen overlay: canvas fills everything, text overlaid */
.sig-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--white);
    display: flex;
    flex-direction: row;
}

.sig-overlay.hidden {
    display: none !important;
}

/* Canvas wrapper: takes all space except the button bar */
.sig-overlay-canvas-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
    min-height: 0;
}

.sig-overlay-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    touch-action: none;
    cursor: crosshair;
    z-index: 0;
}

/* Articles + confirm text overlaid on top-left of canvas */
.sig-overlay-info {
    position: absolute;
    top: 8px;
    left: 12px;
    right: 80px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.55;
    font-size: 11px;
    line-height: 1.3;
    color: var(--dark);
}

.sig-info-articles {
    margin-bottom: 4px;
}

.sig-article-item {
    display: flex;
    gap: 6px;
    padding: 1px 0;
    font-size: 11px;
    align-items: baseline;
}

.sig-article-qty {
    font-weight: 700;
    color: var(--green);
    min-width: 26px;
}

.sig-article-info {
    flex: 1;
    min-width: 0;
}

.sig-article-name {
    color: var(--dark);
}

.sig-article-sku {
    font-size: 9px;
    color: var(--gray);
    font-family: 'Courier New', monospace;
}

.sig-info-confirm {
    font-size: 10px;
    color: var(--gray);
    margin-top: 4px;
    font-style: italic;
}

/* Date overlaid at bottom-left of canvas */
.sig-overlay-location {
    position: absolute;
    bottom: 10px;
    left: 16px;
    z-index: 1;
    font-size: 12px;
    color: var(--gray);
    pointer-events: none;
    opacity: 0.6;
}

/* Vertical button bar on the right side */
.sig-overlay-bar {
    width: 56px;
    flex-shrink: 0;
    background: var(--gray-lighter);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    gap: 8px;
}

.sig-bar-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
}

.sig-bar-close {
    background: var(--gray-light);
    color: var(--gray);
    font-size: 24px;
}

.sig-bar-close:active {
    background: var(--gray);
    color: var(--white);
}

.sig-bar-clear {
    background: var(--red-light);
    color: var(--red);
    margin-top: auto;
}

.sig-bar-clear:active {
    background: var(--red);
    color: var(--white);
}

.sig-bar-confirm {
    background: var(--green);
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    height: auto;
    padding: 10px 4px;
    writing-mode: vertical-lr;
    text-orientation: mixed;
    letter-spacing: 1px;
}

.sig-bar-confirm:active {
    background: var(--green-dark);
}

/* Complete Screen */
.complete-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60vh;
    padding: 32px 24px;
}

.checkmark-circle {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #dcfce7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #166534;
    margin-bottom: 24px;
    animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.complete-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.complete-subtitle {
    font-size: 16px;
    color: var(--gray);
    margin-bottom: 32px;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--white);
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo img {
    height: 40px;
    border-radius: 6px;
}

.login-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-subtitle {
    text-align: center;
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 28px;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--gray-light);
    border-radius: 10px;
    transition: border-color 0.2s;
    background: var(--white);
}

.form-input:focus {
    border-color: var(--green);
    outline: none;
}

.login-error {
    background: var(--red-light);
    color: var(--red);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.login-error.show {
    display: block;
}

/* Utility */
.text-center { text-align: center; }
.text-green { color: var(--green); }
.text-gray { color: var(--gray); }
.text-red { color: var(--red); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.spinner.dark {
    border-color: rgba(0,0,0,0.1);
    border-top-color: var(--green);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 600;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.error {
    background: var(--red);
}

.toast.success {
    background: var(--green-dark);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Tab Bar */
.tab-bar {
    display: flex;
    background: var(--white);
    border-top: 1px solid var(--gray-light);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px 10px;
    border: none;
    background: none;
    color: var(--gray);
    font-size: 11px;
    cursor: pointer;
    min-height: 52px;
    justify-content: center;
}

.tab-btn.active {
    color: var(--green);
}

.tab-btn .tab-icon {
    font-size: 22px;
}

/* Adjust screen padding when tab bar is visible */
.has-tabs .screen {
    padding-bottom: 72px;
}

/* ==================== INCOMING GOODS (Wareneingang) ==================== */

/* Progress bar */
.ig-progress-wrap {
    margin-top: 6px;
}

.ig-progress-bar {
    height: 6px;
    background: var(--gray-light);
    border-radius: 3px;
    overflow: hidden;
}

.ig-progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.ig-progress-text {
    font-size: 11px;
    color: var(--gray);
    margin-top: 3px;
    text-align: right;
}

/* Incoming goods detail items */
.ig-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-lighter);
    cursor: pointer;
    transition: background 0.1s;
}

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

.ig-item:active {
    background: var(--gray-lighter);
}

.ig-item.confirmed {
    opacity: 0.7;
}

.ig-item-info {
    flex: 1;
    min-width: 0;
}

.ig-item-name {
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
}

.ig-item-sku {
    font-size: 11px;
    color: var(--gray);
    font-family: 'Courier New', monospace;
    margin-top: 2px;
}

.ig-item-qty {
    font-size: 13px;
    color: var(--gray);
    margin-top: 2px;
}

.ig-item-status {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.ig-item-status.pending {
    background: var(--gray-lighter);
    color: var(--gray);
}

.ig-item-status.partial {
    background: #fff3cd;
    color: #92400e;
}

.ig-item-status.done {
    background: #dcfce7;
    color: #166534;
}

/* Confirm Item Dialog Overlay */
.ig-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 400;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: fadeIn 0.15s ease;
}

.ig-dialog-overlay.hidden {
    display: none !important;
}

.ig-dialog {
    background: var(--white);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.ig-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ig-dialog-header span {
    font-size: 18px;
    font-weight: 700;
}

.ig-dialog-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-lighter);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
}

.ig-dialog-article {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--gray-lighter);
    border-radius: 8px;
}

.ig-dialog-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ig-dialog-qty-section {
    margin-bottom: 20px;
}

.ig-dialog-qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.ig-qty-btn {
    width: 52px;
    height: 52px;
    border: 2px solid var(--gray-light);
    background: var(--white);
    border-radius: 12px;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
}

.ig-qty-btn:active {
    background: var(--gray-lighter);
    border-color: var(--green);
}

.ig-qty-input {
    width: 80px;
    height: 52px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    -moz-appearance: textfield;
    -webkit-appearance: none;
}

.ig-qty-input:focus {
    border-color: var(--green);
    outline: none;
}

.ig-qty-input::-webkit-outer-spin-button,
.ig-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ig-dialog-serial-section {
    margin-bottom: 20px;
}

/* Reminder button */
.btn-reminder {
    background: none;
    border: 2px solid var(--orange);
    color: var(--orange);
    font-size: 14px;
    font-weight: 600;
}

.btn-reminder:active {
    background: var(--orange);
    color: var(--white);
}

/* Bottom safe area for standalone mode */
@media (display-mode: standalone) {
    .screen {
        padding-bottom: 32px;
    }

    .has-tabs .screen {
        padding-bottom: 80px;
    }
}
