:root {
    --primary-color: #f7941E;
    --secondary-color: #757575;
    --success-color: #2f6fa8;
    --danger-color: #ff0000;
    --warning-color: #ff9800;
    --text-color: #333;
    --text-grey: #666;
    --bg-color: #f5f5f5;
    --border-color: #ddd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.header {
    background: linear-gradient(135deg, var(--primary-color), #1976D2);
    color: white;
    padding: 20px;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    margin-bottom: 5px;
    color: white;
}

.header img {
    /* Logo wird in Originalfarben angezeigt */
    object-fit: contain;
    flex-shrink: 0;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border-color);
}

.nav-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-grey);
    transition: all 0.3s;
}

.nav-tab:hover {
    color: var(--primary-color);
    background: rgba(33, 150, 243, 0.05);
}

.nav-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.scanner-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.scanner-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1976D2;
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #616161;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.manual-input {
    margin-top: 20px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

#reader {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.scan-result {
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
}

.scan-result.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.scan-result.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

.scan-result.info {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #2196f3;
}

.items-list {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.item-card {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 10px;
    background: white;
}

.item-info {
    flex: 1;
}

.item-info h3 {
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--text-color);
}

.item-info p {
    font-size: 14px;
    color: var(--text-grey);
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-grey);
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .nav-tab {
        width: 100%;
        text-align: left;
    }
    
    .scanner-controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    /* Lagerort-Karten: Löschen-Button nicht volle Breite */
    .item-card > .btn {
        width: auto;
        min-width: 80px;
        white-space: nowrap;
        margin-left: auto;
    }
    
    /* Item-Karten: Buttons-Gruppe anpassen */
    .item-card > div:last-child {
        display: flex;
        gap: 5px;
        flex-wrap: wrap;
    }
    
    .item-card > div:last-child .btn {
        flex: 0 0 auto;
        min-width: 70px;
        width: auto;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), #1976D2);
    color: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 20px;
    background-color: #f5f5f5;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#reader {
    width: 100%;
    min-height: 300px;
    position: relative;
}

#reader video {
    width: 100%;
    height: auto;
    border-radius: 4px;
}
